home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| Nim source code, ASCII text
| default (weak)
| |
100%
| TrID
| LaTeX 2e document (with rem)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 0a 25 20 54 68 65 20 | 46 45 45 4c 20 6d 61 6e |%.% The |FEEL man|
|00000010| 75 61 6c 20 73 6f 75 72 | 63 65 73 2e 0a 25 0a 25 |ual sour|ces..%.%|
|00000020| 20 24 49 64 3a 20 66 65 | 65 6c 2e 74 65 78 2c 76 | $Id: fe|el.tex,v|
|00000030| 20 32 2e 30 20 31 39 39 | 32 2f 30 33 2f 31 35 20 | 2.0 199|2/03/15 |
|00000040| 31 37 3a 32 30 3a 30 35 | 20 70 61 62 20 45 78 70 |17:20:05| pab Exp|
|00000050| 20 70 61 62 20 24 0a 25 | 0a 25 20 24 4c 6f 67 3a | pab $.%|.% $Log:|
|00000060| 20 66 65 65 6c 2e 74 65 | 78 2c 76 20 24 0a 25 20 | feel.te|x,v $.% |
|00000070| 52 65 76 69 73 69 6f 6e | 20 32 2e 30 20 20 31 39 |Revision| 2.0 19|
|00000080| 39 32 2f 30 33 2f 31 35 | 20 20 31 37 3a 32 30 3a |92/03/15| 17:20:|
|00000090| 30 35 20 20 70 61 62 0a | 25 20 6e 65 77 20 76 65 |05 pab.|% new ve|
|000000a0| 72 73 69 6f 6e 0a 25 0a | 25 20 0a 25 20 52 65 76 |rsion.%.|% .% Rev|
|000000b0| 69 73 69 6f 6e 20 31 2e | 38 20 20 39 30 2f 31 31 |ision 1.|8 90/11|
|000000c0| 2f 30 37 20 20 32 31 3a | 33 34 3a 33 31 20 20 6b |/07 21:|34:31 k|
|000000d0| 6a 70 0a 25 20 4d 61 6b | 65 20 63 6f 6e 66 69 67 |jp.% Mak|e config|
|000000e0| 75 72 61 74 69 6f 6e 73 | 2c 20 73 74 61 72 74 20 |urations|, start |
|000000f0| 75 70 20 63 75 73 74 6f | 6d 69 73 61 74 69 6f 6e |up custo|misation|
|00000100| 73 2c 20 21 3e 20 61 6e | 64 20 66 75 74 75 72 65 |s, !> an|d future|
|00000110| 73 2e 0a 25 0a 0a 5c 64 | 6f 63 75 6d 65 6e 74 73 |s..%..\d|ocuments|
|00000120| 74 79 6c 65 5b 66 75 6c | 6c 70 61 67 65 2c 61 34 |tyle[ful|lpage,a4|
|00000130| 2c 65 75 6c 69 73 70 5d | 7b 61 72 74 69 63 6c 65 |,eulisp]|{article|
|00000140| 7d 0a 5c 64 65 66 5c 56 | 65 72 73 69 6f 6e 7b 30 |}.\def\V|ersion{0|
|00000150| 2e 38 39 7d 0a 5c 6d 61 | 6b 65 69 6e 64 65 78 0a |.89}.\ma|keindex.|
|00000160| 5c 74 69 74 6c 65 7b 46 | 45 45 4c 3a 20 41 6e 20 |\title{F|EEL: An |
|00000170| 49 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 6f |Implemen|tation o|
|00000180| 66 20 45 7b 5c 6c 61 72 | 67 65 20 55 7d 4c 7b 5c |f E{\lar|ge U}L{\|
|00000190| 6c 61 72 67 65 20 49 53 | 50 7d 5c 5c 0a 56 65 72 |large IS|P}\\.Ver|
|000001a0| 73 69 6f 6e 20 5c 56 65 | 72 73 69 6f 6e 7d 0a 5c |sion \Ve|rsion}.\|
|000001b0| 61 75 74 68 6f 72 7b 0a | 43 6f 6e 63 75 72 72 65 |author{.|Concurre|
|000001c0| 6e 74 20 50 72 6f 63 65 | 73 73 69 6e 67 20 52 65 |nt Proce|ssing Re|
|000001d0| 73 65 61 72 63 68 20 47 | 72 6f 75 70 5c 5c 20 53 |search G|roup\\ S|
|000001e0| 63 68 6f 6f 6c 20 6f 66 | 20 4d 61 74 68 65 6d 61 |chool of| Mathema|
|000001f0| 74 69 63 61 6c 0a 53 63 | 69 65 6e 63 65 73 5c 5c |tical.Sc|iences\\|
|00000200| 20 55 6e 69 76 65 72 73 | 69 74 79 20 6f 66 20 42 | Univers|ity of B|
|00000210| 61 74 68 2c 20 55 6e 69 | 74 65 64 20 4b 69 6e 67 |ath, Uni|ted King|
|00000220| 64 6f 6d 5c 5c 20 45 2d | 6d 61 69 6c 3a 20 7b 5c |dom\\ E-|mail: {\|
|00000230| 74 74 0a 65 75 6c 69 73 | 70 40 6d 61 74 68 73 2e |tt.eulis|p@maths.|
|00000240| 62 61 74 68 2e 61 63 2e | 75 6b 7d 20 7d 0a 5c 6e |bath.ac.|uk} }.\n|
|00000250| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 73 74 61 6e 64 |ewcomman|d{\stand|
|00000260| 61 72 64 7d 5b 31 5d 7b | 5c 65 6e 74 72 79 7b 23 |ard}[1]{|\entry{#|
|00000270| 31 7d 7b 5c 6c 65 76 65 | 6c 7d 7d 0a 5c 6e 65 77 |1}{\leve|l}}.\new|
|00000280| 63 6f 6d 6d 61 6e 64 7b | 5c 61 63 63 65 73 73 6f |command{|\accesso|
|00000290| 72 7d 5b 31 5d 7b 5c 65 | 6e 74 72 79 7b 23 31 7d |r}[1]{\e|ntry{#1}|
|000002a0| 7b 5c 6c 65 76 65 6c 20 | 61 63 63 65 73 73 6f 72 |{\level |accessor|
|000002b0| 7d 7d 0a 5c 6e 65 77 63 | 6f 6d 6d 61 6e 64 7b 5c |}}.\newc|ommand{\|
|000002c0| 63 6f 6e 73 74 72 75 63 | 74 6f 72 7d 5b 31 5d 7b |construc|tor}[1]{|
|000002d0| 5c 65 6e 74 72 79 7b 23 | 31 7d 7b 5c 6c 65 76 65 |\entry{#|1}{\leve|
|000002e0| 6c 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 7d 7d 0a |l constr|uctor}}.|
|000002f0| 5c 6e 65 77 63 6f 6d 6d | 61 6e 64 7b 5c 75 70 64 |\newcomm|and{\upd|
|00000300| 61 74 6f 72 7d 5b 31 5d | 7b 5c 65 6e 74 72 79 7b |ator}[1]|{\entry{|
|00000310| 23 31 7d 7b 5c 6c 65 76 | 65 6c 20 75 70 64 61 74 |#1}{\lev|el updat|
|00000320| 6f 72 7d 7d 0a 5c 6e 65 | 77 63 6f 6d 6d 61 6e 64 |or}}.\ne|wcommand|
|00000330| 7b 5c 67 65 6e 7d 5b 31 | 5d 7b 5c 65 6e 74 72 79 |{\gen}[1|]{\entry|
|00000340| 7b 23 31 7d 7b 5c 6c 65 | 76 65 6c 5c 20 67 65 6e |{#1}{\le|vel\ gen|
|00000350| 65 72 69 63 7d 7d 0a 5c | 6e 65 77 63 6f 6d 6d 61 |eric}}.\|newcomma|
|00000360| 6e 64 7b 5c 6d 74 64 7d | 5b 31 5d 7b 5c 65 6e 74 |nd{\mtd}|[1]{\ent|
|00000370| 72 79 7b 23 31 7d 7b 5c | 6c 65 76 65 6c 20 6d 65 |ry{#1}{\|level me|
|00000380| 74 68 6f 64 7d 7d 0a 5c | 6e 65 77 63 6f 6d 6d 61 |thod}}.\|newcomma|
|00000390| 6e 64 7b 5c 63 6f 6d 6d | 65 6e 74 7d 5b 31 5d 7b |nd{\comm|ent}[1]{|
|000003a0| 7d 0a 5c 6e 65 77 63 6f | 6d 6d 61 6e 64 7b 5c 63 |}.\newco|mmand{\c|
|000003b0| 6c 61 73 73 6e 61 6d 65 | 7d 5b 31 5d 7b 7b 5c 74 |lassname|}[1]{{\t|
|000003c0| 74 20 3c 23 31 3e 7d 7d | 0a 5c 6e 65 77 63 6f 6d |t <#1>}}|.\newcom|
|000003d0| 6d 61 6e 64 7b 5c 66 69 | 6c 65 6e 61 6d 65 7d 5b |mand{\fi|lename}[|
|000003e0| 31 5d 7b 7b 5c 74 74 20 | 23 31 7d 7d 0a 5c 62 65 |1]{{\tt |#1}}.\be|
|000003f0| 67 69 6e 7b 64 6f 63 75 | 6d 65 6e 74 7d 0a 5c 6d |gin{docu|ment}.\m|
|00000400| 61 6b 65 74 69 74 6c 65 | 5c 74 68 69 73 70 61 67 |aketitle|\thispag|
|00000410| 65 73 74 79 6c 65 7b 65 | 6d 70 74 79 7d 0a 5c 64 |estyle{e|mpty}.\d|
|00000420| 65 66 5c 6c 65 76 65 6c | 7b 46 65 65 6c 7d 0a 0a |ef\level|{Feel}..|
|00000430| 5c 62 65 67 69 6e 7b 61 | 62 73 74 72 61 63 74 7d |\begin{a|bstract}|
|00000440| 0a 20 20 54 68 69 73 20 | 64 6f 63 75 6d 65 6e 74 |. This |document|
|00000450| 20 64 65 73 63 72 69 62 | 65 73 20 61 6e 20 69 6d | describ|es an im|
|00000460| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |plementa|tion of |
|00000470| 5c 65 75 6c 69 73 70 5c | 20 63 61 6c 6c 65 64 20 |\eulisp\| called |
|00000480| 5c 66 65 65 6c 2e 0a 20 | 20 54 68 65 20 70 72 69 |\feel.. | The pri|
|00000490| 6d 61 72 79 20 72 65 66 | 65 72 65 6e 63 65 20 66 |mary ref|erence f|
|000004a0| 6f 72 20 5c 65 75 6c 69 | 73 70 5c 20 69 73 20 74 |or \euli|sp\ is t|
|000004b0| 68 65 20 5c 65 75 6c 69 | 73 70 5c 20 64 65 66 69 |he \euli|sp\ defi|
|000004c0| 6e 69 74 69 6f 6e 2e 20 | 20 49 6e 0a 20 20 74 68 |nition. | In. th|
|000004d0| 69 73 20 64 6f 63 75 6d | 65 6e 74 2c 20 74 68 65 |is docum|ent, the|
|000004e0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 61 6c 20 6f | environ|mental o|
|000004f0| 70 65 72 61 74 69 6f 6e | 73 20 70 72 6f 76 69 64 |peration|s provid|
|00000500| 65 64 20 69 6e 20 5c 66 | 65 65 6c 2c 20 62 75 74 |ed in \f|eel, but|
|00000510| 0a 20 20 77 68 69 63 68 | 20 61 72 65 20 6e 6f 74 |. which| are not|
|00000520| 20 70 61 72 74 20 6f 66 | 20 74 68 65 20 5c 65 75 | part of| the \eu|
|00000530| 6c 69 73 70 5c 20 6c 61 | 6e 67 75 61 67 65 2c 20 |lisp\ la|nguage, |
|00000540| 61 72 65 20 64 65 73 63 | 72 69 62 65 64 20 69 6e |are desc|ribed in|
|00000550| 0a 20 20 64 65 74 61 69 | 6c 2c 20 61 6e 64 20 65 |. detai|l, and e|
|00000560| 78 61 6d 70 6c 65 73 20 | 6f 6e 20 74 68 65 20 75 |xamples |on the u|
|00000570| 73 65 20 6f 66 20 73 6f | 6d 65 20 65 75 6c 69 73 |se of so|me eulis|
|00000580| 70 20 66 65 61 74 75 72 | 65 73 20 61 72 65 0a 20 |p featur|es are. |
|00000590| 20 70 72 6f 76 69 64 65 | 64 2e 0a 5c 65 6e 64 7b | provide|d..\end{|
|000005a0| 61 62 73 74 72 61 63 74 | 7d 0a 0a 5c 73 65 63 74 |abstract|}..\sect|
|000005b0| 69 6f 6e 7b 47 65 74 74 | 69 6e 67 20 66 75 72 74 |ion{Gett|ing furt|
|000005c0| 68 65 72 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 7d |her info|rmation}|
|000005d0| 0a 49 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 61 62 6f |.Informa|tion abo|
|000005e0| 75 74 20 5c 65 75 6c 69 | 73 70 5c 20 61 6e 64 20 |ut \euli|sp\ and |
|000005f0| 61 20 63 6f 70 79 20 6f | 66 20 74 68 65 20 5c 66 |a copy o|f the \f|
|00000600| 65 65 6c 5c 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |eel\ imp|lementat|
|00000610| 69 6f 6e 20 61 72 65 0a | 61 6c 6c 20 61 76 61 69 |ion are.|all avai|
|00000620| 6c 61 62 6c 65 20 66 72 | 6f 6d 20 74 68 65 20 7b |lable fr|om the {|
|00000630| 5c 74 74 20 65 75 64 69 | 73 74 7d 20 6d 61 69 6c |\tt eudi|st} mail|
|00000640| 20 73 65 72 76 65 72 20 | 61 74 20 74 68 65 20 55 | server |at the U|
|00000650| 6e 69 76 65 72 73 69 74 | 79 20 6f 66 0a 42 61 74 |niversit|y of.Bat|
|00000660| 68 2e 20 20 48 65 72 65 | 20 69 73 20 61 20 73 75 |h. Here| is a su|
|00000670| 6d 6d 61 72 79 20 6f 66 | 20 74 68 65 20 73 65 72 |mmary of| the ser|
|00000680| 76 69 63 65 73 20 70 72 | 6f 76 69 64 65 64 5c 66 |vices pr|ovided\f|
|00000690| 6f 6f 74 6e 6f 74 65 7b | 54 68 65 73 65 0a 61 64 |ootnote{|These.ad|
|000006a0| 64 72 65 73 73 65 73 20 | 6d 61 79 20 6e 6f 74 20 |dresses |may not |
|000006b0| 77 6f 72 6b 2e 20 54 68 | 65 20 61 75 74 68 6f 72 |work. Th|e author|
|000006c0| 73 20 6f 66 20 74 68 69 | 73 20 64 6f 63 75 6d 65 |s of thi|s docume|
|000006d0| 6e 74 20 61 72 65 20 7b | 5c 74 74 0a 70 61 62 2c |nt are {|\tt.pab,|
|000006e0| 6a 61 70 40 6d 61 74 68 | 73 2e 62 61 74 68 2e 61 |jap@math|s.bath.a|
|000006f0| 63 2e 75 6b 7d 7d 3a 0a | 0a 5c 6d 65 64 73 6b 69 |c.uk}}:.|.\medski|
|00000700| 70 0a 5c 62 65 67 69 6e | 7b 74 61 62 75 6c 61 72 |p.\begin|{tabular|
|00000710| 7d 7b 7c 6c 7c 6c 7c 70 | 7b 37 63 6d 7d 7c 7d 5c |}{|l|l|p|{7cm}|}\|
|00000720| 68 6c 69 6e 65 0a 20 20 | 41 64 64 72 65 73 73 20 |hline. |Address |
|00000730| 26 20 53 75 62 6a 65 63 | 74 20 46 69 65 6c 64 20 |& Subjec|t Field |
|00000740| 26 20 45 66 66 65 63 74 | 20 5c 5c 5c 68 6c 69 6e |& Effect| \\\hlin|
|00000750| 65 5c 68 6c 69 6e 65 20 | 7b 5c 74 74 0a 20 20 65 |e\hline |{\tt. e|
|00000760| 75 64 69 73 74 40 6d 61 | 74 68 73 2e 62 61 74 68 |udist@ma|ths.bath|
|00000770| 2e 61 63 2e 75 6b 7d 20 | 26 20 7b 5c 74 74 20 66 |.ac.uk} |& {\tt f|
|00000780| 65 65 6c 7d 20 26 20 44 | 69 73 74 72 69 62 75 74 |eel} & D|istribut|
|00000790| 65 73 20 74 68 65 20 63 | 75 72 72 65 6e 74 0a 20 |es the c|urrent. |
|000007a0| 20 72 65 6c 65 61 73 65 | 20 6f 66 20 5c 66 65 65 | release| of \fee|
|000007b0| 6c 2e 20 20 45 61 63 68 | 20 66 69 6c 65 20 77 69 |l. Each| file wi|
|000007c0| 6c 6c 20 62 65 20 73 65 | 6e 74 20 69 6e 64 69 76 |ll be se|nt indiv|
|000007d0| 69 64 75 61 6c 6c 79 20 | 69 6e 20 61 0a 20 20 75 |idually |in a. u|
|000007e0| 75 65 6e 63 6f 64 65 64 | 2c 20 63 6f 6d 70 72 65 |uencoded|, compre|
|000007f0| 73 73 65 64 20 66 6f 72 | 6d 61 74 2e 0a 20 20 5c |ssed for|mat.. \|
|00000800| 5c 5c 68 6c 69 6e 65 20 | 7b 5c 74 74 20 65 75 64 |\\hline |{\tt eud|
|00000810| 69 73 74 40 6d 61 74 68 | 73 2e 62 61 74 68 2e 61 |ist@math|s.bath.a|
|00000820| 63 2e 75 6b 7d 20 26 20 | 7b 5c 74 74 20 64 65 66 |c.uk} & |{\tt def|
|00000830| 69 6e 69 74 69 6f 6e 7d | 20 26 0a 20 20 44 69 73 |inition}| &. Dis|
|00000840| 74 72 69 62 75 74 65 73 | 20 74 68 65 20 63 75 72 |tributes| the cur|
|00000850| 72 65 6e 74 20 72 65 6c | 65 61 73 65 20 6f 66 20 |rent rel|ease of |
|00000860| 74 68 65 20 5c 65 75 6c | 69 73 70 5c 20 64 65 66 |the \eul|isp\ def|
|00000870| 69 6e 69 74 69 6f 6e 2c | 0a 20 20 72 61 74 69 6f |inition,|. ratio|
|00000880| 6e 61 6c 65 20 61 6e 64 | 20 63 6f 6d 6d 65 6e 74 |nale and| comment|
|00000890| 61 72 79 20 69 6e 20 7b | 5c 74 74 20 2e 64 76 69 |ary in {|\tt .dvi|
|000008a0| 7d 20 66 6f 72 6d 61 74 | 2e 20 20 45 61 63 68 20 |} format|. Each |
|000008b0| 66 69 6c 65 20 77 69 6c | 6c 20 62 65 0a 20 20 73 |file wil|l be. s|
|000008c0| 65 6e 74 20 69 6e 64 69 | 76 69 64 75 61 6c 6c 79 |ent indi|vidually|
|000008d0| 20 69 6e 20 61 20 75 75 | 65 6e 63 6f 64 65 64 2c | in a uu|encoded,|
|000008e0| 20 63 6f 6d 70 72 65 73 | 73 65 64 20 66 6f 72 6d | compres|sed form|
|000008f0| 61 74 2e 0a 20 20 5c 5c | 5c 68 6c 69 6e 65 20 7b |at.. \\|\hline {|
|00000900| 5c 74 74 20 65 75 62 75 | 67 40 6d 61 74 68 73 2e |\tt eubu|g@maths.|
|00000910| 62 61 74 68 2e 61 63 2e | 75 6b 7d 20 26 20 73 6f |bath.ac.|uk} & so|
|00000920| 6d 65 74 68 69 6e 67 20 | 67 65 72 6d 61 6e 65 20 |mething |germane |
|00000930| 26 20 50 6c 65 61 73 65 | 0a 20 20 70 72 6f 76 69 |& Please|. provi|
|00000940| 64 65 20 62 6f 64 79 20 | 74 6f 6f 21 20 20 54 68 |de body |too! Th|
|00000950| 69 73 20 6d 61 69 6c 2d | 69 64 20 69 73 20 66 6f |is mail-|id is fo|
|00000960| 72 20 72 65 70 6f 72 74 | 69 6e 67 20 62 75 67 73 |r report|ing bugs|
|00000970| 20 69 6e 20 74 68 65 0a | 20 20 64 65 66 69 6e 69 | in the.| defini|
|00000980| 74 69 6f 6e 20 6f 72 20 | 69 6e 20 5c 66 65 65 6c |tion or |in \feel|
|00000990| 2e 0a 20 20 5c 5c 5c 68 | 6c 69 6e 65 0a 5c 65 6e |.. \\\h|line.\en|
|000009a0| 64 7b 74 61 62 75 6c 61 | 72 7d 0a 0a 5c 73 65 63 |d{tabula|r}..\sec|
|000009b0| 74 69 6f 6e 7b 4d 61 6b | 69 6e 67 20 46 45 45 4c |tion{Mak|ing FEEL|
|000009c0| 7d 0a 54 68 65 20 6b 69 | 6e 64 20 6f 66 20 5c 66 |}.The ki|nd of \f|
|000009d0| 65 65 6c 5c 20 73 79 73 | 74 65 6d 20 79 6f 75 20 |eel\ sys|tem you |
|000009e0| 63 61 6e 20 6d 61 6b 65 | 20 64 65 70 65 6e 64 73 |can make| depends|
|000009f0| 20 6f 6e 20 74 68 65 20 | 63 6f 6d 62 69 6e 65 64 | on the |combined|
|00000a00| 0a 63 61 70 61 62 69 6c | 69 74 69 65 73 20 6f 66 |.capabil|ities of|
|00000a10| 20 79 6f 75 72 20 6f 70 | 65 72 61 74 69 6e 67 20 | your op|erating |
|00000a20| 73 79 73 74 65 6d 20 61 | 6e 64 20 70 72 6f 63 65 |system a|nd proce|
|00000a30| 73 73 6f 72 2e 20 20 5c | 66 65 65 6c 5c 20 68 61 |ssor. \|feel\ ha|
|00000a40| 73 20 62 65 65 6e 0a 64 | 65 76 65 6c 6f 70 65 64 |s been.d|eveloped|
|00000a50| 20 69 6e 20 61 20 73 6f | 6c 65 6c 79 20 55 6e 69 | in a so|lely Uni|
|00000a60| 78 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 61 6e |x enviro|nment an|
|00000a70| 64 20 74 68 69 73 20 68 | 61 73 20 63 6f 6e 73 69 |d this h|as consi|
|00000a80| 64 65 72 61 62 6c 79 0a | 77 61 72 70 65 64 20 69 |derably.|warped i|
|00000a90| 74 73 20 76 69 65 77 20 | 6f 66 20 74 68 65 20 77 |ts view |of the w|
|00000aa0| 6f 72 6c 64 2e 20 20 53 | 6f 20 66 61 72 2c 20 5c |orld. S|o far, \|
|00000ab0| 66 65 65 6c 5c 20 68 61 | 73 20 6f 6e 6c 79 20 62 |feel\ ha|s only b|
|00000ac0| 65 65 6e 20 70 6f 72 74 | 65 64 20 74 6f 0a 64 69 |een port|ed to.di|
|00000ad0| 66 66 65 72 65 6e 74 20 | 76 65 72 73 69 6f 6e 73 |fferent |versions|
|00000ae0| 20 6f 66 20 55 6e 69 78 | 2e 20 20 41 20 70 61 72 | of Unix|. A par|
|00000af0| 74 69 63 75 6c 61 72 20 | 66 65 61 74 75 72 65 20 |ticular |feature |
|00000b00| 6f 66 20 5c 65 75 6c 69 | 73 70 5c 20 69 73 0a 73 |of \euli|sp\ is.s|
|00000b10| 75 70 70 6f 72 74 20 66 | 6f 72 20 6d 75 6c 74 69 |upport f|or multi|
|00000b20| 70 6c 65 20 74 68 72 65 | 61 64 73 20 6f 66 20 63 |ple thre|ads of c|
|00000b30| 6f 6e 74 72 6f 6c 2e 20 | 20 57 68 65 74 68 65 72 |ontrol. | Whether|
|00000b40| 20 74 68 65 73 65 20 64 | 6f 20 61 63 74 75 61 6c | these d|o actual|
|00000b50| 6c 79 0a 65 78 65 63 75 | 74 65 20 63 6f 6e 63 75 |ly.execu|te concu|
|00000b60| 72 72 65 6e 74 6c 79 20 | 64 65 70 65 6e 64 73 20 |rrently |depends |
|00000b70| 6f 6e 20 74 68 65 20 68 | 6f 73 74 20 73 79 73 74 |on the h|ost syst|
|00000b80| 65 6d 2c 20 62 75 74 2c | 20 69 6e 20 70 72 69 6e |em, but,| in prin|
|00000b90| 63 69 70 6c 65 2c 20 69 | 74 0a 73 68 6f 75 6c 64 |ciple, i|t.should|
|00000ba0| 20 62 65 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 | be poss|ible to |
|00000bb0| 64 65 76 65 6c 6f 70 20 | 61 20 70 72 6f 67 72 61 |develop |a progra|
|00000bc0| 6d 20 75 73 69 6e 67 20 | 74 68 72 65 61 64 73 20 |m using |threads |
|00000bd0| 6f 6e 20 6f 6e 65 0a 73 | 79 73 74 65 6d 2d 2d 2d |on one.s|ystem---|
|00000be0| 70 65 72 68 61 70 73 20 | 61 20 75 6e 69 2d 70 72 |perhaps |a uni-pr|
|00000bf0| 6f 63 65 73 73 6f 72 20 | 73 69 6d 75 6c 61 74 69 |ocessor |simulati|
|00000c00| 6e 67 20 63 6f 6e 63 75 | 72 72 65 6e 63 79 2d 2d |ng concu|rrency--|
|00000c10| 2d 61 6e 64 20 6c 61 74 | 65 72 0a 65 78 65 63 75 |-and lat|er.execu|
|00000c20| 74 65 20 74 68 65 20 73 | 61 6d 65 20 70 72 6f 67 |te the s|ame prog|
|00000c30| 72 61 6d 20 6f 6e 20 61 | 20 6d 75 6c 74 69 2d 70 |ram on a| multi-p|
|00000c40| 72 6f 63 65 73 73 6f 72 | 20 6f 72 20 61 20 64 69 |rocessor| or a di|
|00000c50| 73 74 72 69 62 75 74 65 | 64 0a 70 72 6f 63 65 73 |stribute|d.proces|
|00000c60| 73 6f 72 20 74 6f 20 61 | 63 68 69 65 76 65 20 74 |sor to a|chieve t|
|00000c70| 68 65 20 73 61 6d 65 20 | 6e 65 74 20 72 65 73 75 |he same |net resu|
|00000c80| 6c 74 2e 0a 0a 42 72 6f | 61 64 6c 79 20 73 70 65 |lt...Bro|adly spe|
|00000c90| 61 6b 69 6e 67 2c 20 5c | 66 65 65 6c 5c 20 63 61 |aking, \|feel\ ca|
|00000ca0| 6e 20 62 65 20 6d 61 64 | 65 20 69 6e 20 61 6e 79 |n be mad|e in any|
|00000cb0| 20 6f 66 20 74 68 72 65 | 65 20 6d 61 69 6e 0a 63 | of thre|e main.c|
|00000cc0| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 73 20 5c 64 |onfigura|tions \d|
|00000cd0| 6f 74 73 0a 0a 5c 62 65 | 67 69 6e 7b 64 65 73 63 |ots..\be|gin{desc|
|00000ce0| 72 69 70 74 69 6f 6e 7d | 0a 20 20 0a 5c 69 74 65 |ription}|. .\ite|
|00000cf0| 6d 5b 47 65 6e 65 72 69 | 63 5d 20 55 6e 64 65 72 |m[Generi|c] Under|
|00000d00| 20 74 68 65 20 60 60 61 | 6e 79 27 27 20 6d 61 63 | the ``a|ny'' mac|
|00000d10| 68 69 6e 65 20 63 6f 6e | 66 69 67 75 72 61 74 69 |hine con|figurati|
|00000d20| 6f 6e 2c 20 5c 66 65 65 | 6c 5c 0a 20 20 61 74 74 |on, \fee|l\. att|
|00000d30| 65 6d 70 74 73 20 74 6f | 20 62 65 20 61 20 66 75 |empts to| be a fu|
|00000d40| 6c 6c 79 20 70 6f 72 74 | 61 62 6c 65 20 41 4e 53 |lly port|able ANS|
|00000d50| 49 20 43 20 70 72 6f 67 | 72 61 6d 2e 20 42 65 63 |I C prog|ram. Bec|
|00000d60| 61 75 73 65 20 74 68 65 | 72 65 20 69 73 20 6e 6f |ause the|re is no|
|00000d70| 0a 20 20 72 65 6c 69 61 | 62 6c 79 20 70 6f 72 74 |. relia|bly port|
|00000d80| 61 62 6c 65 20 6d 65 74 | 68 6f 64 20 6f 66 20 69 |able met|hod of i|
|00000d90| 6d 70 6c 65 6d 65 6e 74 | 69 6e 67 20 74 68 72 65 |mplement|ing thre|
|00000da0| 61 64 73 20 69 6e 20 43 | 2c 20 74 68 65 20 74 68 |ads in C|, the th|
|00000db0| 72 65 61 64 0a 20 20 6f | 70 65 72 61 74 69 6f 6e |read. o|peration|
|00000dc0| 73 20 69 6e 20 74 68 69 | 73 20 6d 6f 64 65 20 61 |s in thi|s mode a|
|00000dd0| 72 65 20 6e 6f 74 20 61 | 76 61 69 6c 61 62 6c 65 |re not a|vailable|
|00000de0| 20 61 6e 64 20 6f 6e 6c | 79 20 61 20 73 65 72 69 | and onl|y a seri|
|00000df0| 61 6c 20 76 65 72 73 69 | 6f 6e 20 6f 66 0a 20 20 |al versi|on of. |
|00000e00| 5c 65 75 6c 69 73 70 5c | 20 72 65 6d 61 69 6e 73 |\eulisp\| remains|
|00000e10| 2e 20 54 68 69 73 20 6d | 6f 64 65 20 69 73 20 6d |. This m|ode is m|
|00000e20| 6f 73 74 20 73 75 69 74 | 61 62 6c 65 20 66 6f 72 |ost suit|able for|
|00000e30| 20 67 65 74 74 69 6e 67 | 20 73 74 61 72 74 65 64 | getting| started|
|00000e40| 0a 20 20 71 75 69 63 6b | 6c 79 20 61 6e 64 20 61 |. quick|ly and a|
|00000e50| 6c 73 6f 20 74 68 65 20 | 6d 6f 73 74 20 73 65 6e |lso the |most sen|
|00000e60| 73 69 62 6c 65 20 70 6c | 61 63 65 20 74 6f 20 62 |sible pl|ace to b|
|00000e70| 65 67 69 6e 20 66 6f 72 | 20 70 6f 72 74 69 6e 67 |egin for| porting|
|00000e80| 20 74 6f 20 6e 65 77 0a | 20 20 61 72 63 68 69 74 | to new.| archit|
|00000e90| 65 63 74 75 72 65 73 20 | 6f 72 20 6f 70 65 72 61 |ectures |or opera|
|00000ea0| 74 69 6e 67 20 73 79 73 | 74 65 6d 73 2e 20 4d 65 |ting sys|tems. Me|
|00000eb0| 6d 6f 72 79 20 75 73 65 | 20 69 73 20 6d 69 6e 69 |mory use| is mini|
|00000ec0| 6d 69 73 65 64 20 77 68 | 69 63 68 20 6d 61 79 0a |mised wh|ich may.|
|00000ed0| 20 20 62 65 6e 69 66 69 | 74 20 73 6d 61 6c 6c 65 | benifi|t smalle|
|00000ee0| 72 20 6d 61 63 68 69 6e | 65 73 20 73 75 63 68 20 |r machin|es such |
|00000ef0| 61 73 20 50 43 73 20 6f | 72 20 61 6e 79 20 73 79 |as PCs o|r any sy|
|00000f00| 73 74 65 6d 20 77 68 65 | 72 65 20 6d 65 6d 6f 72 |stem whe|re memor|
|00000f10| 79 20 69 73 20 61 74 0a | 20 20 61 20 70 72 65 6d |y is at.| a prem|
|00000f20| 69 75 6d 2e 0a 20 20 0a | 5c 69 74 65 6d 5b 42 53 |ium.. .|\item[BS|
|00000f30| 44 5d 20 54 68 69 73 20 | 28 62 61 64 6c 79 20 6e |D] This |(badly n|
|00000f40| 61 6d 65 64 29 20 63 6f | 6e 66 69 67 75 72 61 74 |amed) co|nfigurat|
|00000f50| 69 6f 6e 20 6d 6f 64 65 | 20 72 65 71 75 69 72 65 |ion mode| require|
|00000f60| 73 20 74 68 61 74 20 61 | 20 73 74 61 63 6b 0a 20 |s that a| stack. |
|00000f70| 20 73 77 69 74 63 68 69 | 6e 67 20 6f 70 65 72 61 | switchi|ng opera|
|00000f80| 74 69 6f 6e 20 62 65 20 | 61 76 61 69 6c 61 62 6c |tion be |availabl|
|00000f90| 65 20 66 6f 72 20 5c 66 | 65 65 6c 5c 20 74 6f 20 |e for \f|eel\ to |
|00000fa0| 75 73 65 2e 20 47 69 76 | 65 6e 20 74 68 69 73 20 |use. Giv|en this |
|00000fb0| 63 6f 64 65 0a 20 20 28 | 74 79 70 69 63 61 6c 6c |code. (|typicall|
|00000fc0| 79 20 61 20 66 65 77 20 | 6c 69 6e 65 73 20 6f 66 |y a few |lines of|
|00000fd0| 20 74 68 65 20 6c 6f 63 | 61 6c 20 61 73 73 65 6d | the loc|al assem|
|00000fe0| 62 6c 65 72 29 2c 20 74 | 68 65 20 74 68 72 65 61 |bler), t|he threa|
|00000ff0| 64 20 6f 70 65 72 61 74 | 69 6f 6e 73 0a 20 20 62 |d operat|ions. b|
|00001000| 65 63 6f 6d 65 20 61 76 | 61 69 6c 61 62 6c 65 20 |ecome av|ailable |
|00001010| 77 69 74 68 20 74 68 65 | 20 6c 69 6d 69 74 61 74 |with the| limitat|
|00001020| 69 6f 6e 20 74 68 61 74 | 20 6f 6e 6c 79 20 6f 6e |ion that| only on|
|00001030| 65 20 74 68 72 65 61 64 | 20 69 73 20 72 75 6e 20 |e thread| is run |
|00001040| 61 74 20 61 0a 20 20 74 | 69 6d 65 2e 20 20 54 68 |at a. t|ime. Th|
|00001050| 69 73 20 6d 6f 64 65 20 | 61 6c 6c 6f 77 73 20 70 |is mode |allows p|
|00001060| 72 6f 67 72 61 6d 73 20 | 74 6f 20 62 65 20 77 72 |rograms |to be wr|
|00001070| 69 74 74 65 6e 20 69 6e | 20 74 65 72 6d 73 20 6f |itten in| terms o|
|00001080| 66 20 74 68 72 65 61 64 | 73 0a 20 20 77 68 69 63 |f thread|s. whic|
|00001090| 68 20 6d 61 79 20 6c 61 | 74 65 72 20 62 65 20 72 |h may la|ter be r|
|000010a0| 75 6e 20 69 6e 20 70 61 | 72 61 6c 6c 65 6c 20 77 |un in pa|rallel w|
|000010b0| 69 74 68 6f 75 74 20 61 | 6c 74 65 72 61 74 69 6f |ithout a|lteratio|
|000010c0| 6e 2e 20 54 68 69 73 20 | 6d 6f 64 65 20 69 73 0a |n. This |mode is.|
|000010d0| 20 20 6d 6f 73 74 20 75 | 73 65 66 75 6c 20 66 6f | most u|seful fo|
|000010e0| 72 20 61 6c 6c 6f 77 69 | 6e 67 20 74 68 65 20 64 |r allowi|ng the d|
|000010f0| 65 76 65 6c 6f 70 69 6e | 67 20 6d 75 6c 74 69 2d |evelopin|g multi-|
|00001100| 74 68 72 65 61 64 65 64 | 20 61 70 70 6c 69 63 61 |threaded| applica|
|00001110| 74 69 6f 6e 73 0a 20 20 | 75 6e 64 65 72 20 75 6e |tions. |under un|
|00001120| 73 75 70 70 6f 72 74 69 | 76 65 20 6f 70 65 72 61 |supporti|ve opera|
|00001130| 74 69 6e 67 20 73 79 73 | 74 65 6d 73 20 73 75 63 |ting sys|tems suc|
|00001140| 68 20 61 73 20 42 53 44 | 20 34 2e 32 20 6f 72 20 |h as BSD| 4.2 or |
|00001150| 34 2e 33 2e 0a 20 20 0a | 5c 69 74 65 6d 5b 53 79 |4.3.. .|\item[Sy|
|00001160| 73 74 65 6d 20 56 5d 20 | 54 68 69 73 20 63 6f 6e |stem V] |This con|
|00001170| 66 69 67 75 72 61 74 69 | 6f 6e 20 72 65 71 75 69 |figurati|on requi|
|00001180| 72 65 73 20 74 68 61 74 | 20 73 74 61 63 6b 20 73 |res that| stack s|
|00001190| 77 69 74 63 68 69 6e 67 | 20 63 6f 64 65 0a 20 20 |witching| code. |
|000011a0| 62 65 20 61 76 61 69 6c | 61 62 6c 65 20 61 6c 6f |be avail|able alo|
|000011b0| 6e 67 20 77 69 74 68 20 | 74 68 65 20 73 74 61 6e |ng with |the stan|
|000011c0| 64 61 72 64 20 53 79 73 | 74 65 6d 20 56 20 73 68 |dard Sys|tem V sh|
|000011d0| 61 72 65 64 20 6d 65 6d | 6f 72 79 0a 20 20 6d 61 |ared mem|ory. ma|
|000011e0| 6e 69 70 75 6c 61 74 69 | 6f 6e 20 70 72 69 6d 69 |nipulati|on primi|
|000011f0| 74 69 76 65 73 2e 20 47 | 69 76 65 6e 20 74 68 65 |tives. G|iven the|
|00001200| 73 65 20 74 68 69 6e 67 | 73 20 5c 66 65 65 6c 5c |se thing|s \feel\|
|00001210| 20 62 65 63 6f 6d 65 73 | 20 61 20 74 72 75 6c 79 | becomes| a truly|
|00001220| 0a 20 20 70 61 72 61 6c | 6c 65 6c 20 6d 75 6c 74 |. paral|lel mult|
|00001230| 69 2d 74 68 72 65 61 64 | 65 64 20 73 79 73 74 65 |i-thread|ed syste|
|00001240| 6d 20 75 73 69 6e 67 20 | 74 68 65 20 66 6f 6c 6c |m using |the foll|
|00001250| 6f 77 69 6e 67 20 6d 6f | 64 65 6c 3a 20 6f 6e 20 |owing mo|del: on |
|00001260| 73 74 61 72 74 2d 75 70 | 0a 20 20 61 20 70 69 65 |start-up|. a pie|
|00001270| 63 65 20 6f 66 20 73 68 | 61 72 65 64 20 6d 65 6d |ce of sh|ared mem|
|00001280| 6f 72 79 20 69 73 20 61 | 6c 6c 6f 63 61 74 65 64 |ory is a|llocated|
|00001290| 2c 20 74 68 65 6e 20 5c | 66 65 65 6c 5c 20 66 6f |, then \|feel\ fo|
|000012a0| 72 6b 73 20 61 73 20 6d | 61 6e 79 20 74 69 6d 65 |rks as m|any time|
|000012b0| 73 0a 20 20 61 73 20 74 | 68 65 72 65 20 61 72 65 |s. as t|here are|
|000012c0| 20 70 68 79 73 69 63 61 | 6c 20 70 72 6f 63 65 73 | physica|l proces|
|000012d0| 73 6f 72 73 20 69 6e 20 | 74 68 65 20 68 6f 73 74 |sors in |the host|
|000012e0| 20 6d 61 63 68 69 6e 65 | 20 28 74 68 69 73 20 62 | machine| (this b|
|000012f0| 65 68 61 76 69 6f 75 72 | 0a 20 20 6d 61 79 20 62 |ehaviour|. may b|
|00001300| 65 20 6d 6f 64 69 66 69 | 65 64 29 2e 20 20 45 61 |e modifi|ed). Ea|
|00001310| 63 68 20 6f 66 20 74 68 | 65 73 65 20 66 6f 72 6b |ch of th|ese fork|
|00001320| 65 64 20 70 72 6f 63 65 | 73 73 65 73 20 72 75 6e |ed proce|sses run|
|00001330| 73 20 74 68 65 20 5c 66 | 65 65 6c 5c 0a 20 20 73 |s the \f|eel\. s|
|00001340| 63 68 65 64 75 6c 65 72 | 2c 20 72 75 6e 6e 69 6e |cheduler|, runnin|
|00001350| 67 20 74 68 72 65 61 64 | 73 20 66 72 6f 6d 20 74 |g thread|s from t|
|00001360| 68 65 20 70 6f 6f 6c 20 | 69 6e 20 74 68 65 20 73 |he pool |in the s|
|00001370| 68 61 72 65 64 20 68 65 | 61 70 2e 20 20 45 61 63 |hared he|ap. Eac|
|00001380| 68 0a 20 20 73 75 63 68 | 20 74 68 72 65 61 64 20 |h. such| thread |
|00001390| 69 73 20 72 75 6e 20 74 | 6f 20 63 6f 6e 63 6c 75 |is run t|o conclu|
|000013a0| 73 69 6f 6e 2d 2d 2d 75 | 6e 6c 65 73 73 20 69 74 |sion---u|nless it|
|000013b0| 20 79 69 65 6c 64 73 20 | 63 6f 6e 74 72 6f 6c 2c | yields |control,|
|000013c0| 20 69 6e 20 77 68 69 63 | 68 0a 20 20 63 61 73 65 | in whic|h. case|
|000013d0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 72 65 74 75 | it will| be retu|
|000013e0| 72 6e 65 64 20 74 6f 20 | 74 68 65 20 70 6f 6f 6c |rned to |the pool|
|000013f0| 2e 20 4d 6f 72 65 20 70 | 72 6f 63 65 73 73 65 73 |. More p|rocesses|
|00001400| 20 6d 61 79 20 62 65 20 | 66 6f 72 6b 65 64 0a 20 | may be |forked. |
|00001410| 20 74 68 61 6e 20 65 78 | 69 73 74 69 6e 67 20 70 | than ex|isting p|
|00001420| 72 6f 63 65 73 73 6f 72 | 73 20 74 6f 20 73 69 6d |rocessor|s to sim|
|00001430| 75 6c 61 74 65 20 74 72 | 75 6c 79 20 70 61 72 61 |ulate tr|uly para|
|00001440| 6c 6c 65 6c 20 6f 70 65 | 72 61 74 69 6f 6e 20 6f |llel ope|ration o|
|00001450| 6e 0a 20 20 75 6e 69 70 | 72 6f 63 65 73 73 6f 72 |n. unip|rocessor|
|00001460| 20 73 79 73 74 65 6d 73 | 20 73 75 63 68 20 61 73 | systems| such as|
|00001470| 20 53 75 6e 73 20 72 75 | 6e 6e 69 6e 67 20 53 75 | Suns ru|nning Su|
|00001480| 6e 4f 53 20 34 2e 31 2e | 0a 20 20 0a 5c 65 6e 64 |nOS 4.1.|. .\end|
|00001490| 7b 64 65 73 63 72 69 70 | 74 69 6f 6e 7d 0a 0a 5c |{descrip|tion}..\|
|000014a0| 73 65 63 74 69 6f 6e 7b | 54 68 65 20 46 45 45 4c |section{|The FEEL|
|000014b0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 7d 0a 0a 5c | environ|ment}..\|
|000014c0| 66 65 65 6c 5c 20 75 73 | 65 73 20 74 68 65 20 73 |feel\ us|es the s|
|000014d0| 68 65 6c 6c 20 76 61 72 | 69 61 62 6c 65 20 5c 76 |hell var|iable \v|
|000014e0| 65 72 62 3f 46 45 45 4c | 5f 4c 4f 41 44 5f 50 41 |erb?FEEL|_LOAD_PA|
|000014f0| 54 48 3f 20 74 6f 20 6c | 6f 61 64 20 6d 6f 64 75 |TH? to l|oad modu|
|00001500| 6c 65 73 2e 20 20 49 66 | 0a 74 68 69 73 20 76 61 |les. If|.this va|
|00001510| 72 69 61 62 6c 65 20 69 | 73 20 75 6e 73 65 74 2c |riable i|s unset,|
|00001520| 20 74 68 65 6e 20 6d 6f | 64 75 6c 65 73 20 61 72 | then mo|dules ar|
|00001530| 65 20 73 6f 75 67 68 74 | 20 69 6e 20 74 68 65 20 |e sought| in the |
|00001540| 64 69 72 65 63 74 6f 72 | 79 20 69 6e 0a 77 68 69 |director|y in.whi|
|00001550| 63 68 20 5c 66 65 65 6c | 5c 20 77 61 73 20 69 6e |ch \feel|\ was in|
|00001560| 76 6f 6b 65 64 20 61 6e | 64 20 69 6e 20 61 20 64 |voked an|d in a d|
|00001570| 69 72 65 63 74 6f 72 79 | 20 73 70 65 63 69 66 69 |irectory| specifi|
|00001580| 65 64 20 77 68 65 6e 20 | 74 68 65 20 73 79 73 74 |ed when |the syst|
|00001590| 65 6d 0a 77 61 73 20 62 | 75 69 6c 74 2e 20 20 54 |em.was b|uilt. T|
|000015a0| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 5c 76 65 72 |he value| of \ver|
|000015b0| 62 3f 46 45 45 4c 5f 4c | 4f 41 44 5f 50 41 54 48 |b?FEEL_L|OAD_PATH|
|000015c0| 3f 20 69 73 20 72 65 61 | 64 20 61 74 20 73 74 61 |? is rea|d at sta|
|000015d0| 72 74 2d 75 70 20 61 6e | 64 0a 63 6f 6e 76 65 72 |rt-up an|d.conver|
|000015e0| 74 65 64 20 74 6f 20 61 | 20 6c 69 73 74 20 6f 66 |ted to a| list of|
|000015f0| 20 73 74 72 69 6e 67 73 | 20 6f 66 20 69 6e 66 6f | strings| of info|
|00001600| 72 6d 61 74 69 6f 6e 20 | 69 6e 20 61 20 70 72 6f |rmation |in a pro|
|00001610| 63 65 73 73 6f 72 2d 64 | 65 66 69 6e 65 64 0a 66 |cessor-d|efined.f|
|00001620| 6f 72 6d 61 74 20 63 6f | 6e 63 65 72 6e 69 6e 67 |ormat co|ncerning|
|00001630| 20 74 68 65 20 66 69 6c | 65 73 79 73 74 65 6d 73 | the fil|esystems|
|00001640| 20 6f 72 20 64 69 73 6b | 73 20 6f 72 20 64 69 72 | or disk|s or dir|
|00001650| 65 63 74 6f 72 69 65 73 | 20 74 6f 20 62 65 0a 73 |ectories| to be.s|
|00001660| 65 61 72 63 68 65 64 20 | 77 68 65 6e 20 6c 6f 61 |earched |when loa|
|00001670| 64 69 6e 67 20 6d 6f 64 | 75 6c 65 73 2e 20 20 4d |ding mod|ules. M|
|00001680| 6f 64 75 6c 65 73 20 61 | 72 65 20 73 74 6f 72 65 |odules a|re store|
|00001690| 64 20 69 6e 20 66 69 6c | 65 73 20 77 69 74 68 20 |d in fil|es with |
|000016a0| 74 68 65 0a 65 78 74 65 | 6e 73 69 6f 6e 20 7b 5c |the.exte|nsion {\|
|000016b0| 74 74 20 2e 65 6d 7d 2e | 0a 0a 53 69 6d 69 6c 61 |tt .em}.|..Simila|
|000016c0| 72 6c 79 2c 20 74 68 65 | 20 73 68 65 6c 6c 20 76 |rly, the| shell v|
|000016d0| 61 72 69 61 62 6c 65 20 | 5c 76 65 72 62 7c 46 45 |ariable |\verb|FE|
|000016e0| 45 4c 5f 49 4e 54 46 5f | 50 41 54 48 7c 20 69 73 |EL_INTF_|PATH| is|
|000016f0| 20 75 73 65 64 20 74 6f | 20 66 69 6e 64 0a 6d 6f | used to| find.mo|
|00001700| 64 75 6c 65 20 69 6e 74 | 65 72 66 61 63 65 20 66 |dule int|erface f|
|00001710| 69 6c 65 73 2e 20 20 49 | 66 20 74 68 65 20 76 61 |iles. I|f the va|
|00001720| 72 69 61 62 6c 65 20 69 | 73 20 75 6e 73 65 74 2c |riable i|s unset,|
|00001730| 20 6f 6e 6c 79 20 74 68 | 65 20 64 69 72 65 63 74 | only th|e direct|
|00001740| 6f 72 79 0a 69 6e 20 77 | 68 69 63 68 20 5c 66 65 |ory.in w|hich \fe|
|00001750| 65 6c 5c 20 77 61 73 20 | 69 6e 76 6f 6b 65 64 20 |el\ was |invoked |
|00001760| 77 69 6c 6c 20 62 65 20 | 73 65 61 72 63 68 65 64 |will be |searched|
|00001770| 2e 20 20 54 68 65 20 76 | 61 6c 75 65 20 6f 66 0a |. The v|alue of.|
|00001780| 5c 76 65 72 62 7c 46 45 | 45 4c 5f 49 4e 54 46 5f |\verb|FE|EL_INTF_|
|00001790| 50 41 54 48 7c 20 69 73 | 20 72 65 61 64 20 61 74 |PATH| is| read at|
|000017a0| 20 73 74 61 72 74 2d 75 | 70 20 61 6e 64 20 63 6f | start-u|p and co|
|000017b0| 6e 76 65 72 74 65 64 20 | 69 6e 20 61 20 6d 61 6e |nverted |in a man|
|000017c0| 6e 65 72 0a 61 6e 61 6c | 6f 67 6f 75 73 20 74 6f |ner.anal|ogous to|
|000017d0| 20 74 68 61 74 20 66 6f | 72 20 5c 76 65 72 62 7c | that fo|r \verb||
|000017e0| 46 45 45 4c 5f 4c 4f 41 | 44 5f 50 41 54 48 7c 2e |FEEL_LOA|D_PATH|.|
|000017f0| 20 20 49 6e 74 65 72 66 | 61 63 65 73 20 61 72 65 | Interf|aces are|
|00001800| 20 73 74 6f 72 65 64 20 | 69 6e 0a 66 69 6c 65 73 | stored |in.files|
|00001810| 20 77 69 74 68 20 74 68 | 65 20 65 78 74 65 6e 73 | with th|e extens|
|00001820| 69 6f 6e 20 7b 5c 74 74 | 20 2e 69 7d 2e 0a 0a 5c |ion {\tt| .i}...\|
|00001830| 73 75 62 73 65 63 74 69 | 6f 6e 7b 47 65 74 74 69 |subsecti|on{Getti|
|00001840| 6e 67 20 69 6e 20 61 6e | 64 20 6f 75 74 7d 0a 5c |ng in an|d out}.\|
|00001850| 66 65 65 6c 5c 20 69 73 | 20 73 74 61 72 74 65 64 |feel\ is| started|
|00001860| 20 62 79 20 74 79 70 69 | 6e 67 20 7b 5c 74 74 20 | by typi|ng {\tt |
|00001870| 66 65 65 6c 7d 2c 20 61 | 73 73 75 6d 69 6e 67 20 |feel}, a|ssuming |
|00001880| 63 6f 72 72 65 63 74 20 | 70 61 74 68 73 20 61 6e |correct |paths an|
|00001890| 64 0a 69 6e 73 74 61 6c | 6c 61 74 69 6f 6e 2e 20 |d.instal|lation. |
|000018a0| 20 54 6f 20 6c 65 61 76 | 65 20 5c 66 65 65 6c 5c | To leav|e \feel\|
|000018b0| 20 74 79 70 65 20 43 4e | 54 4c 2d 44 2c 20 6f 72 | type CN|TL-D, or|
|000018c0| 20 70 6f 73 73 69 62 6c | 79 20 7b 5c 74 74 20 21 | possibl|y {\tt !|
|000018d0| 65 78 69 74 7d 0a 28 73 | 65 65 20 6c 61 74 65 72 |exit}.(s|ee later|
|000018e0| 20 73 65 63 74 69 6f 6e | 29 2e 0a 0a 5c 73 75 62 | section|)...\sub|
|000018f0| 73 65 63 74 69 6f 6e 7b | 49 6e 74 65 72 61 63 74 |section{|Interact|
|00001900| 69 6e 67 20 77 69 74 68 | 20 46 45 45 4c 7d 0a 0a |ing with| FEEL}..|
|00001910| 57 68 65 6e 20 5c 66 65 | 65 6c 5c 20 73 74 61 72 |When \fe|el\ star|
|00001920| 74 73 2c 20 74 68 65 20 | 74 6f 70 2d 6c 65 76 65 |ts, the |top-leve|
|00001930| 6c 20 69 73 20 69 6e 69 | 74 69 61 6c 6c 79 20 73 |l is ini|tially s|
|00001940| 65 74 20 74 6f 20 74 68 | 65 20 7b 5c 74 74 20 75 |et to th|e {\tt u|
|00001950| 73 65 72 7d 0a 6d 6f 64 | 75 6c 65 5c 66 6f 6f 74 |ser}.mod|ule\foot|
|00001960| 6e 6f 74 65 7b 54 68 69 | 73 20 63 61 6e 20 62 65 |note{Thi|s can be|
|00001970| 20 63 68 61 6e 67 65 64 | 20 62 79 20 73 65 74 74 | changed| by sett|
|00001980| 69 6e 67 20 74 68 65 20 | 65 6e 76 69 72 6f 6e 6d |ing the |environm|
|00001990| 65 6e 74 0a 76 61 72 69 | 61 62 6c 65 20 46 45 45 |ent.vari|able FEE|
|000019a0| 4c 5c 5f 53 54 41 52 54 | 5c 5f 4d 4f 44 55 4c 45 |L\_START|\_MODULE|
|000019b0| 7d 2e 20 54 68 69 73 20 | 69 6d 70 6f 72 74 73 20 |}. This |imports |
|000019c0| 7b 5c 74 74 20 65 75 6c | 69 73 70 30 7d 2c 20 61 |{\tt eul|isp0}, a|
|000019d0| 6e 64 20 0a 74 68 65 72 | 65 66 6f 72 65 20 63 6f |nd .ther|efore co|
|000019e0| 6e 74 61 69 6e 73 20 6d | 6f 73 74 20 6f 66 20 74 |ntains m|ost of t|
|000019f0| 68 65 20 75 73 75 61 6c | 20 6c 69 73 70 20 66 75 |he usual| lisp fu|
|00001a00| 6e 63 74 69 6f 6e 73 2e | 20 4d 6f 73 74 20 6f 66 |nctions.| Most of|
|00001a10| 20 74 68 65 0a 6d 6f 64 | 75 6c 65 20 6d 61 6e 69 | the.mod|ule mani|
|00001a20| 70 75 6c 61 74 69 6f 6e | 20 66 75 6e 63 74 69 6f |pulation| functio|
|00001a30| 6e 61 6c 69 74 79 20 69 | 73 20 64 65 66 69 6e 65 |nality i|s define|
|00001a40| 64 20 69 6e 20 74 68 65 | 20 7b 5c 74 74 20 72 6f |d in the| {\tt ro|
|00001a50| 6f 74 7d 20 6d 6f 64 75 | 6c 65 2e 0a 54 68 65 20 |ot} modu|le..The |
|00001a60| 6f 6e 6c 79 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |only ope|rations |
|00001a70| 64 65 66 69 6e 65 64 20 | 69 6e 20 74 68 65 20 7b |defined |in the {|
|00001a80| 5c 74 74 20 72 6f 6f 74 | 7d 20 6d 6f 64 75 6c 65 |\tt root|} module|
|00001a90| 20 61 72 65 20 74 68 6f | 73 65 20 66 6f 72 0a 6c | are tho|se for.l|
|00001aa0| 6f 61 64 69 6e 67 20 6d | 6f 64 75 6c 65 73 20 61 |oading m|odules a|
|00001ab0| 6e 64 20 65 6e 74 65 72 | 69 6e 67 20 6d 6f 64 75 |nd enter|ing modu|
|00001ac0| 6c 65 73 20 28 73 65 65 | 20 62 65 6c 6f 77 29 2e |les (see| below).|
|00001ad0| 20 54 68 65 20 74 6f 70 | 2d 6c 65 76 65 6c 20 70 | The top|-level p|
|00001ae0| 72 6f 6d 70 74 0a 70 72 | 6f 76 69 64 65 73 20 69 |rompt.pr|ovides i|
|00001af0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00001b00| 20 77 68 69 63 68 20 6d | 6f 64 75 6c 65 20 69 73 | which m|odule is|
|00001b10| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 66 6f 63 | the cur|rent foc|
|00001b20| 75 73 20 61 6e 64 20 74 | 68 65 0a 68 69 73 74 6f |us and t|he.histo|
|00001b30| 72 79 20 6e 75 6d 62 65 | 72 20 6f 66 20 74 68 65 |ry numbe|r of the|
|00001b40| 20 63 6f 6d 6d 61 6e 64 | 2c 20 66 6f 72 20 65 78 | command|, for ex|
|00001b50| 61 6d 70 6c 65 3a 0a 0a | 5c 62 65 67 69 6e 7b 76 |ample:..|\begin{v|
|00001b60| 65 72 62 61 74 69 6d 7d | 0a 65 75 6c 69 73 70 3a |erbatim}|.eulisp:|
|00001b70| 30 3a 72 6f 6f 74 21 33 | 3e 0a 5c 65 6e 64 7b 76 |0:root!3|>.\end{v|
|00001b80| 65 72 62 61 74 69 6d 7d | 0a 0a 5c 6e 6f 69 6e 64 |erbatim}|..\noind|
|00001b90| 65 6e 74 0a 73 69 67 6e | 69 66 69 65 73 20 74 68 |ent.sign|ifies th|
|00001ba0| 61 74 20 74 68 65 20 74 | 6f 70 2d 6c 65 76 65 6c |at the t|op-level|
|00001bb0| 20 69 73 20 65 78 65 63 | 75 74 69 6e 67 20 6f 6e | is exec|uting on|
|00001bc0| 20 74 68 72 65 61 64 20 | 7b 5c 74 74 20 30 7d 2c | thread |{\tt 0},|
|00001bd0| 20 74 68 65 0a 63 75 72 | 72 65 6e 74 20 6d 6f 64 | the.cur|rent mod|
|00001be0| 75 6c 65 20 66 6f 63 75 | 73 20 69 73 20 7b 5c 74 |ule focu|s is {\t|
|00001bf0| 74 20 72 6f 6f 74 7d 20 | 61 6e 64 20 74 68 61 74 |t root} |and that|
|00001c00| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 20 68 69 73 | the com|mand his|
|00001c10| 74 6f 72 79 20 69 6e 64 | 65 78 0a 6f 66 20 74 68 |tory ind|ex.of th|
|00001c20| 69 73 20 6c 69 6e 65 20 | 69 73 20 7b 5c 74 74 20 |is line |is {\tt |
|00001c30| 33 7d 2e 0a 0a 5c 62 65 | 67 69 6e 7b 76 65 72 62 |3}...\be|gin{verb|
|00001c40| 61 74 69 6d 7d 0a 65 75 | 6c 69 73 70 2d 68 61 6e |atim}.eu|lisp-han|
|00001c50| 64 6c 65 72 3a 30 3a 73 | 6f 63 6b 65 74 73 21 31 |dler:0:s|ockets!1|
|00001c60| 3e 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |>.\end{v|erbatim}|
|00001c70| 0a 0a 5c 6e 6f 69 6e 64 | 65 6e 74 0a 73 69 67 6e |..\noind|ent.sign|
|00001c80| 69 66 69 65 73 20 74 68 | 61 74 20 74 68 65 20 74 |ifies th|at the t|
|00001c90| 6f 70 2d 6c 65 76 65 6c | 20 68 61 6e 64 6c 65 72 |op-level| handler|
|00001ca0| 20 69 73 20 65 78 65 63 | 75 74 69 6e 67 20 6f 6e | is exec|uting on|
|00001cb0| 20 74 68 72 65 61 64 20 | 7b 5c 74 74 20 30 7d 2c | thread |{\tt 0},|
|00001cc0| 0a 74 68 65 20 63 75 72 | 72 65 6e 74 20 6d 6f 64 |.the cur|rent mod|
|00001cd0| 75 6c 65 20 66 6f 63 75 | 73 20 69 73 20 7b 5c 74 |ule focu|s is {\t|
|00001ce0| 74 20 73 6f 63 6b 65 74 | 73 7d 20 61 6e 64 20 74 |t socket|s} and t|
|00001cf0| 68 61 74 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 |hat the |command |
|00001d00| 68 69 73 74 6f 72 79 0a | 69 6e 64 65 78 20 6f 66 |history.|index of|
|00001d10| 20 74 68 69 73 20 6c 69 | 6e 65 20 69 73 20 7b 5c | this li|ne is {\|
|00001d20| 74 74 20 31 7d 2e 20 20 | 54 68 65 20 66 6f 6c 6c |tt 1}. |The foll|
|00001d30| 6f 77 69 6e 67 20 6f 70 | 65 72 61 74 69 6f 6e 73 |owing op|erations|
|00001d40| 20 61 72 65 20 64 65 66 | 69 6e 65 64 0a 69 6e 20 | are def|ined.in |
|00001d50| 74 68 65 20 7b 5c 74 74 | 20 72 6f 6f 74 7d 20 6d |the {\tt| root} m|
|00001d60| 6f 64 75 6c 65 3a 0a 0a | 5c 6b 65 79 77 6f 72 64 |odule:..|\keyword|
|00001d70| 7b 72 65 6c 6f 61 64 2d | 6d 6f 64 75 6c 65 7d 0a |{reload-|module}.|
|00001d80| 5c 62 65 67 69 6e 7b 61 | 72 67 75 6d 65 6e 74 73 |\begin{a|rguments|
|00001d90| 7d 0a 5c 69 74 65 6d 5b | 73 79 6d 62 6f 6c 5d 20 |}.\item[|symbol] |
|00001da0| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 6d 6f 64 75 |name of |the modu|
|00001db0| 6c 65 20 74 6f 20 6c 6f | 61 64 2e 0a 5c 65 6e 64 |le to lo|ad..\end|
|00001dc0| 7b 61 72 67 75 6d 65 6e | 74 73 7d 0a 5c 6b 65 79 |{argumen|ts}.\key|
|00001dd0| 77 6f 72 64 7b 21 3e 3e | 7d 0a 5c 62 65 67 69 6e |word{!>>|}.\begin|
|00001de0| 7b 61 72 67 75 6d 65 6e | 74 73 7d 0a 5c 69 74 65 |{argumen|ts}.\ite|
|00001df0| 6d 5b 73 79 6d 62 6f 6c | 5d 20 6e 61 6d 65 20 6f |m[symbol|] name o|
|00001e00| 66 20 74 68 65 20 6d 6f | 64 75 6c 65 20 74 6f 20 |f the mo|dule to |
|00001e10| 6c 6f 61 64 2e 0a 5c 65 | 6e 64 7b 61 72 67 75 6d |load..\e|nd{argum|
|00001e20| 65 6e 74 73 7d 0a 5c 72 | 65 73 75 6c 74 20 74 68 |ents}.\r|esult th|
|00001e30| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 65 20 6d 6f |e name o|f the mo|
|00001e40| 64 75 6c 65 2e 0a 0a 52 | 65 6c 6f 61 64 20 74 68 |dule...R|eload th|
|00001e50| 65 20 73 70 65 63 69 66 | 69 65 64 20 6d 6f 64 75 |e specif|ied modu|
|00001e60| 6c 65 2e 20 20 54 68 69 | 73 20 68 61 73 20 74 68 |le. Thi|s has th|
|00001e70| 65 20 73 69 64 65 2d 65 | 66 66 65 63 74 20 6f 66 |e side-e|ffect of|
|00001e80| 20 72 65 73 65 74 74 69 | 6e 67 0a 74 68 65 20 65 | resetti|ng.the e|
|00001e90| 78 70 6f 72 74 65 64 20 | 62 69 6e 64 69 6e 67 73 |xported |bindings|
|00001ea0| 20 6f 66 20 74 68 65 20 | 6d 6f 64 75 6c 65 2c 20 | of the |module, |
|00001eb0| 73 75 63 68 20 74 68 61 | 74 20 61 6e 79 20 69 6d |such tha|t any im|
|00001ec0| 70 6f 72 74 69 6e 67 20 | 6d 6f 64 75 6c 65 0a 77 |porting |module.w|
|00001ed0| 69 6c 6c 20 72 65 66 65 | 72 65 6e 63 65 20 74 68 |ill refe|rence th|
|00001ee0| 65 20 6e 65 77 20 76 61 | 6c 75 65 73 2e 20 20 54 |e new va|lues. T|
|00001ef0| 68 69 73 20 6f 70 65 72 | 61 74 69 6f 6e 20 6d 61 |his oper|ation ma|
|00001f00| 79 20 62 65 20 61 62 62 | 72 65 76 69 61 74 65 64 |y be abb|reviated|
|00001f10| 20 74 6f 0a 7b 5c 74 74 | 20 21 3e 3e 7d 20 77 68 | to.{\tt| !>>} wh|
|00001f20| 69 63 68 20 77 69 6c 6c | 20 63 61 75 73 65 20 74 |ich will| cause t|
|00001f30| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 6d 6f 64 |he speci|fied mod|
|00001f40| 75 6c 65 20 74 6f 20 62 | 65 20 72 65 6c 6f 61 64 |ule to b|e reload|
|00001f50| 65 64 20 61 6e 64 0a 63 | 68 61 6e 67 65 20 74 68 |ed and.c|hange th|
|00001f60| 65 20 66 6f 63 75 73 20 | 74 6f 20 74 68 61 74 20 |e focus |to that |
|00001f70| 6d 6f 64 75 6c 65 2e 20 | 20 55 6e 6c 69 6b 65 20 |module. | Unlike |
|00001f80| 7b 5c 74 74 20 72 65 6c | 6f 61 64 2d 6d 6f 64 75 |{\tt rel|oad-modu|
|00001f90| 6c 65 7d 2c 20 7b 5c 74 | 74 0a 21 3e 3e 7d 20 69 |le}, {\t|t.!>>} i|
|00001fa0| 73 20 72 65 63 6f 67 6e | 69 7a 65 64 20 65 76 65 |s recogn|ized eve|
|00001fb0| 72 79 77 68 65 72 65 2e | 0a 0a 5c 73 74 61 6e 64 |rywhere.|..\stand|
|00001fc0| 61 72 64 7b 6c 6f 61 64 | 2d 6c 6f 75 64 6c 79 7d |ard{load|-loudly}|
|00001fd0| 0a 5c 72 65 73 75 6c 74 | 20 41 20 62 6f 6f 6c 65 |.\result| A boole|
|00001fe0| 61 6e 2e 0a 0a 53 77 69 | 74 63 68 20 6f 6e 20 76 |an...Swi|tch on v|
|00001ff0| 65 72 62 6f 73 69 74 79 | 20 6f 66 20 6d 6f 6e 69 |erbosity| of moni|
|00002000| 74 6f 72 69 6e 67 20 64 | 75 72 69 6e 67 20 6d 6f |toring d|uring mo|
|00002010| 64 75 6c 65 20 6c 6f 61 | 64 69 6e 67 2e 0a 0a 5c |dule loa|ding...\|
|00002020| 73 74 61 6e 64 61 72 64 | 7b 6c 6f 61 64 2d 71 75 |standard|{load-qu|
|00002030| 69 65 74 6c 79 7d 0a 5c | 72 65 73 75 6c 74 20 41 |ietly}.\|result A|
|00002040| 20 62 6f 6f 6c 65 61 6e | 2e 0a 0a 0a 53 77 69 74 | boolean|....Swit|
|00002050| 63 68 20 6f 66 66 20 76 | 65 72 62 6f 73 69 74 79 |ch off v|erbosity|
|00002060| 20 6f 66 20 6d 6f 6e 69 | 74 6f 72 69 6e 67 20 64 | of moni|toring d|
|00002070| 75 72 69 6e 67 20 6d 6f | 64 75 6c 65 20 6c 6f 61 |uring mo|dule loa|
|00002080| 64 69 6e 67 2e 0a 0a 5c | 73 74 61 6e 64 61 72 64 |ding...\|standard|
|00002090| 7b 6c 6f 61 64 65 64 2d | 6d 6f 64 75 6c 65 73 7d |{loaded-|modules}|
|000020a0| 0a 5c 72 65 73 75 6c 74 | 20 41 20 6c 69 73 74 20 |.\result| A list |
|000020b0| 6f 66 20 74 68 65 20 6e | 61 6d 65 73 20 6f 66 20 |of the n|ames of |
|000020c0| 74 68 65 20 63 75 72 72 | 65 6e 74 6c 79 20 6c 6f |the curr|ently lo|
|000020d0| 61 64 65 64 20 6d 6f 64 | 75 6c 65 73 2e 0a 0a 5c |aded mod|ules...\|
|000020e0| 6b 65 79 77 6f 72 64 7b | 28 21 3e 7d 0a 5c 62 65 |keyword{|(!>}.\be|
|000020f0| 67 69 6e 7b 61 72 67 75 | 6d 65 6e 74 73 7d 0a 20 |gin{argu|ments}. |
|00002100| 20 5c 69 74 65 6d 5b 6d | 6f 64 75 6c 65 5d 20 4e | \item[m|odule] N|
|00002110| 61 6d 65 20 6f 66 20 6d | 6f 64 75 6c 65 20 74 6f |ame of m|odule to|
|00002120| 20 6c 6f 61 64 2e 0a 5c | 65 6e 64 7b 61 72 67 75 | load..\|end{argu|
|00002130| 6d 65 6e 74 73 7d 0a 5c | 6b 65 79 77 6f 72 64 7b |ments}.\|keyword{|
|00002140| 65 6e 74 65 72 2d 6d 6f | 64 75 6c 65 7d 0a 5c 62 |enter-mo|dule}.\b|
|00002150| 65 67 69 6e 7b 61 72 67 | 75 6d 65 6e 74 73 7d 0a |egin{arg|uments}.|
|00002160| 20 20 5c 69 74 65 6d 5b | 6d 6f 64 75 6c 65 5d 20 | \item[|module] |
|00002170| 4e 61 6d 65 20 6f 66 20 | 6d 6f 64 75 6c 65 20 74 |Name of |module t|
|00002180| 6f 20 6c 6f 61 64 2e 0a | 5c 65 6e 64 7b 61 72 67 |o load..|\end{arg|
|00002190| 75 6d 65 6e 74 73 7d 0a | 5c 72 65 73 75 6c 74 20 |uments}.|\result |
|000021a0| 49 66 20 7b 5c 65 6d 20 | 6d 6f 64 75 6c 65 2d 6e |If {\em |module-n|
|000021b0| 61 6d 65 7d 20 6e 61 6d | 65 73 20 61 20 6d 6f 64 |ame} nam|es a mod|
|000021c0| 75 6c 65 20 77 68 69 63 | 68 20 68 61 73 20 62 65 |ule whic|h has be|
|000021d0| 65 6e 20 6c 6f 61 64 65 | 64 2c 0a 74 68 65 6e 20 |en loade|d,.then |
|000021e0| 74 68 65 20 74 6f 70 2d | 6c 65 76 65 6c 20 69 73 |the top-|level is|
|000021f0| 20 63 68 61 6e 67 65 64 | 20 74 6f 20 62 65 20 69 | changed| to be i|
|00002200| 6e 20 74 68 61 74 20 6d | 6f 64 75 6c 65 2e 20 20 |n that m|odule. |
|00002210| 49 66 20 61 20 6d 6f 64 | 75 6c 65 20 6e 61 6d 65 |If a mod|ule name|
|00002220| 64 0a 7b 5c 65 6d 20 6d | 6f 64 75 6c 65 2d 6e 61 |d.{\em m|odule-na|
|00002230| 6d 65 7d 20 69 73 20 6e | 6f 74 20 63 75 72 72 65 |me} is n|ot curre|
|00002240| 6e 74 6c 79 20 6c 6f 61 | 64 65 64 2c 20 74 68 65 |ntly loa|ded, the|
|00002250| 6e 20 5c 66 65 65 6c 5c | 20 74 72 69 65 73 20 74 |n \feel\| tries t|
|00002260| 6f 20 6c 6f 61 64 0a 74 | 68 65 20 6d 6f 64 75 6c |o load.t|he modul|
|00002270| 65 20 66 72 6f 6d 20 61 | 20 66 69 6c 65 20 63 61 |e from a| file ca|
|00002280| 6c 6c 65 64 20 7b 5c 65 | 6d 20 6d 6f 64 75 6c 65 |lled {\e|m module|
|00002290| 2d 6e 61 6d 65 7d 7b 5c | 74 74 2e 65 6d 7d 2e 20 |-name}{\|tt.em}. |
|000022a0| 20 49 66 20 6c 6f 61 64 | 65 64 0a 73 75 63 63 65 | If load|ed.succe|
|000022b0| 73 66 75 6c 6c 79 2c 20 | 74 6f 70 2d 6c 65 76 65 |sfully, |top-leve|
|000022c0| 6c 20 69 73 20 63 68 61 | 6e 67 65 64 20 74 6f 20 |l is cha|nged to |
|000022d0| 62 65 20 69 6e 20 74 68 | 61 74 20 6d 6f 64 75 6c |be in th|at modul|
|000022e0| 65 2e 20 20 54 68 69 73 | 0a 6f 70 65 72 61 74 69 |e. This|.operati|
|000022f0| 6f 6e 20 6d 61 79 20 62 | 65 20 61 62 62 72 65 76 |on may b|e abbrev|
|00002300| 69 61 74 65 64 20 74 6f | 20 7b 5c 74 74 20 21 3e |iated to| {\tt !>|
|00002310| 7d 2e 20 20 48 6f 77 65 | 76 65 72 2c 20 69 74 20 |}. Howe|ver, it |
|00002320| 69 73 20 61 6c 73 6f 0a | 69 6d 70 6f 72 74 61 6e |is also.|importan|
|00002330| 74 20 74 6f 20 6e 6f 74 | 65 20 74 68 61 74 20 77 |t to not|e that w|
|00002340| 68 69 6c 73 74 20 7b 5c | 74 74 20 65 6e 74 65 72 |hilst {\|tt enter|
|00002350| 2d 6d 6f 64 75 6c 65 7d | 20 69 73 20 6f 6e 6c 79 |-module}| is only|
|00002360| 20 64 65 66 69 6e 65 64 | 20 69 6e 0a 7b 5c 74 74 | defined| in.{\tt|
|00002370| 20 72 6f 6f 74 7d 2c 20 | 7b 5c 74 74 20 21 3e 7d | root}, |{\tt !>}|
|00002380| 20 69 73 20 72 65 63 6f | 67 6e 69 7a 65 64 20 65 | is reco|gnized e|
|00002390| 76 65 72 79 77 68 65 72 | 65 2e 0a 0a 5c 6b 65 79 |verywher|e...\key|
|000023a0| 77 6f 72 64 7b 73 74 61 | 72 74 2d 6d 6f 64 75 6c |word{sta|rt-modul|
|000023b0| 65 7d 0a 5c 62 65 67 69 | 6e 7b 61 72 67 75 6d 65 |e}.\begi|n{argume|
|000023c0| 6e 74 73 7d 0a 20 20 5c | 69 74 65 6d 5b 6d 6f 64 |nts}. \|item[mod|
|000023d0| 75 6c 65 2d 6e 61 6d 65 | 5d 20 4e 61 6d 65 20 6f |ule-name|] Name o|
|000023e0| 66 20 61 20 6d 6f 64 75 | 6c 65 0a 20 20 5c 69 74 |f a modu|le. \it|
|000023f0| 65 6d 5b 66 75 6e 63 74 | 69 6f 6e 2d 6e 61 6d 65 |em[funct|ion-name|
|00002400| 5d 20 4e 61 6d 65 20 6f | 66 20 61 20 66 75 6e 63 |] Name o|f a func|
|00002410| 74 69 6f 6e 0a 20 20 5c | 69 74 65 6d 5b 61 72 67 |tion. \|item[arg|
|00002420| 5d 20 61 72 67 75 6d 65 | 6e 74 0a 5c 65 6e 64 7b |] argume|nt.\end{|
|00002430| 61 72 67 75 6d 65 6e 74 | 73 7d 0a 5c 72 65 73 75 |argument|s}.\resu|
|00002440| 6c 74 20 0a 43 61 6c 6c | 73 20 74 68 65 20 66 75 |lt .Call|s the fu|
|00002450| 6e 63 74 69 6f 6e 20 7b | 5c 65 6d 20 66 75 6e 63 |nction {|\em func|
|00002460| 74 69 6f 6e 2d 6e 61 6d | 65 7d 20 69 6e 20 74 68 |tion-nam|e} in th|
|00002470| 65 20 6d 6f 64 75 6c 65 | 20 7b 5c 65 6d 20 6d 6f |e module| {\em mo|
|00002480| 64 75 6c 65 2d 6e 61 6d | 65 7d 0a 77 69 74 68 20 |dule-nam|e}.with |
|00002490| 74 68 65 20 61 72 67 75 | 6d 65 6e 74 73 20 7b 5c |the argu|ments {\|
|000024a0| 65 6d 20 61 72 67 7d 5c | 2f 24 5e 2a 24 2e 0a 0a |em arg}\|/$^*$...|
|000024b0| 5c 6b 65 79 77 6f 72 64 | 7b 6c 6f 61 64 2d 6d 6f |\keyword|{load-mo|
|000024c0| 64 75 6c 65 7d 0a 5c 62 | 65 67 69 6e 7b 61 72 67 |dule}.\b|egin{arg|
|000024d0| 75 6d 65 6e 74 73 7d 0a | 20 20 5c 69 74 65 6d 5b |uments}.| \item[|
|000024e0| 6d 6f 64 75 6c 65 2d 6e | 61 6d 65 5d 20 41 20 73 |module-n|ame] A s|
|000024f0| 79 6d 62 6f 6c 0a 5c 65 | 6e 64 7b 61 72 67 75 6d |ymbol.\e|nd{argum|
|00002500| 65 6e 74 73 7d 0a 4c 6f | 61 64 20 74 68 65 20 73 |ents}.Lo|ad the s|
|00002510| 70 65 63 69 66 69 65 64 | 20 6d 6f 64 75 6c 65 2e |pecified| module.|
|00002520| 0a 0a 5c 6d 65 64 73 6b | 69 70 0a 5c 61 63 63 65 |..\medsk|ip.\acce|
|00002530| 73 73 6f 72 7b 6c 6f 61 | 64 2d 70 61 74 68 7d 0a |ssor{loa|d-path}.|
|00002540| 5c 75 70 64 61 74 6f 72 | 7b 6c 6f 61 64 2d 70 61 |\updator|{load-pa|
|00002550| 74 68 7d 0a 5c 72 65 73 | 75 6c 74 0a 7b 5c 74 74 |th}.\res|ult.{\tt|
|00002560| 20 6c 6f 61 64 2d 70 61 | 74 68 7d 20 72 65 74 75 | load-pa|th} retu|
|00002570| 72 6e 73 20 61 20 6c 69 | 73 74 20 6f 66 20 73 74 |rns a li|st of st|
|00002580| 72 69 6e 67 73 20 77 68 | 69 63 68 20 64 65 66 69 |rings wh|ich defi|
|00002590| 6e 65 20 74 68 65 20 70 | 61 74 68 73 0a 63 75 72 |ne the p|aths.cur|
|000025a0| 72 65 6e 74 6c 79 20 73 | 65 61 72 63 68 65 64 20 |rently s|earched |
|000025b0| 77 68 65 6e 20 6c 6f 61 | 64 69 6e 67 20 6d 6f 64 |when loa|ding mod|
|000025c0| 75 6c 65 73 20 61 6e 64 | 20 61 63 63 65 73 73 69 |ules and| accessi|
|000025d0| 6e 67 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |ng docum|entation|
|000025e0| 2e 0a 54 68 65 20 73 65 | 74 74 65 72 20 66 75 6e |..The se|tter fun|
|000025f0| 63 74 69 6f 6e 20 70 65 | 72 6d 69 74 73 20 74 68 |ction pe|rmits th|
|00002600| 69 73 20 6c 6f 61 64 20 | 70 61 74 68 20 74 6f 20 |is load |path to |
|00002610| 62 65 20 6d 6f 64 69 66 | 69 65 64 20 64 79 6e 61 |be modif|ied dyna|
|00002620| 6d 69 63 61 6c 6c 79 2e | 0a 5c 5c 0a 49 6e 20 61 |mically.|.\\.In a|
|00002630| 64 64 69 74 69 6f 6e 2c | 20 74 68 65 20 66 6f 6c |ddition,| the fol|
|00002640| 6c 6f 77 69 6e 67 20 66 | 65 61 74 75 72 65 73 20 |lowing f|eatures |
|00002650| 61 72 65 20 70 72 6f 76 | 69 64 65 64 20 66 6f 72 |are prov|ided for|
|00002660| 20 63 6f 6e 74 72 6f 6c | 6c 69 6e 67 20 74 68 65 | control|ling the|
|00002670| 0a 66 6f 63 75 73 20 6f | 66 20 74 68 65 20 74 6f |.focus o|f the to|
|00002680| 70 2d 6c 65 76 65 6c 3a | 0a 0a 5c 6b 65 79 77 6f |p-level:|..\keywo|
|00002690| 72 64 7b 5c 74 74 20 21 | 72 6f 6f 74 7d 0a 0a 43 |rd{\tt !|root}..C|
|000026a0| 68 61 6e 67 65 73 20 74 | 6f 70 2d 6c 65 76 65 6c |hanges t|op-level|
|000026b0| 20 62 61 63 6b 20 74 6f | 20 74 68 65 20 7b 5c 74 | back to| the {\t|
|000026c0| 74 20 72 6f 6f 74 7d 20 | 6d 6f 64 75 6c 65 2e 0a |t root} |module..|
|000026d0| 0a 5c 6b 65 79 77 6f 72 | 64 7b 5c 74 74 20 21 65 |.\keywor|d{\tt !e|
|000026e0| 78 69 74 7d 0a 0a 57 69 | 74 68 69 6e 20 61 20 68 |xit}..Wi|thin a h|
|000026f0| 61 6e 64 6c 65 72 20 6c | 6f 6f 70 2c 20 72 65 74 |andler l|oop, ret|
|00002700| 75 72 6e 73 20 74 6f 20 | 70 72 65 76 69 6f 75 73 |urns to |previous|
|00002710| 20 74 6f 70 2d 6c 65 76 | 65 6c 2e 20 20 41 74 20 | top-lev|el. At |
|00002720| 74 6f 70 2d 6c 65 76 65 | 6c 2c 0a 5c 65 75 6c 69 |top-leve|l,.\euli|
|00002730| 73 70 5c 20 74 65 72 6d | 69 6e 61 74 65 73 2e 0a |sp\ term|inates..|
|00002740| 0a 5c 6b 65 79 77 6f 72 | 64 7b 5c 74 74 20 21 7b |.\keywor|d{\tt !{|
|00002750| 5c 69 74 20 6e 7d 7d 0a | 0a 52 65 64 6f 20 74 68 |\it n}}.|.Redo th|
|00002760| 65 20 69 6e 70 75 74 20 | 73 65 71 75 65 6e 63 65 |e input |sequence|
|00002770| 20 6e 75 6d 62 65 72 20 | 7b 5c 74 74 20 6e 7d 2e | number |{\tt n}.|
|00002780| 0a 0a 5c 6b 65 79 77 6f | 72 64 7b 5c 74 74 20 21 |..\keywo|rd{\tt !|
|00002790| 62 61 63 6b 74 72 61 63 | 65 7d 0a 5c 6b 65 79 77 |backtrac|e}.\keyw|
|000027a0| 6f 72 64 7b 5c 74 74 20 | 21 62 7d 0a 5c 6b 65 79 |ord{\tt |!b}.\key|
|000027b0| 77 6f 72 64 7b 5c 74 74 | 20 21 71 7d 0a 57 69 74 |word{\tt| !q}.Wit|
|000027c0| 68 69 6e 20 74 68 65 20 | 68 61 6e 64 6c 65 72 20 |hin the |handler |
|000027d0| 6c 6f 6f 70 2c 20 70 72 | 69 6e 74 73 20 6f 75 74 |loop, pr|ints out|
|000027e0| 20 61 20 62 61 63 6b 74 | 72 61 63 65 20 6f 66 20 | a backt|race of |
|000027f0| 66 75 6e 63 74 69 6f 6e | 20 63 61 6c 6c 73 20 61 |function| calls a|
|00002800| 6e 64 0a 74 68 65 69 72 | 20 65 6e 76 69 72 6f 6e |nd.their| environ|
|00002810| 6d 65 6e 74 73 2e 20 20 | 54 68 69 73 20 6d 61 79 |ments. |This may|
|00002820| 20 62 65 20 61 62 62 72 | 65 69 76 69 61 74 65 64 | be abbr|eiviated|
|00002830| 20 74 6f 20 7b 5c 74 74 | 20 21 62 7d 2e 20 20 41 | to {\tt| !b}. A|
|00002840| 20 73 69 6d 70 6c 65 72 | 0a 62 61 63 6b 74 72 61 | simpler|.backtra|
|00002850| 63 65 2c 20 6f 6e 6c 79 | 20 63 6f 6e 74 61 69 6e |ce, only| contain|
|00002860| 69 6e 67 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |ing the |function|
|00002870| 20 63 61 6c 6c 73 2c 20 | 63 61 6e 20 62 65 20 70 | calls, |can be p|
|00002880| 72 69 6e 74 65 64 20 6f | 75 74 20 62 79 0a 74 79 |rinted o|ut by.ty|
|00002890| 70 69 6e 67 20 7b 5c 74 | 74 20 21 71 7d 2e 20 54 |ping {\t|t !q}. T|
|000028a0| 68 65 20 7b 5c 74 74 20 | 65 75 6c 69 73 70 30 7d |he {\tt |eulisp0}|
|000028b0| 20 6d 6f 64 75 6c 65 20 | 65 78 70 6f 72 74 73 20 | module |exports |
|000028c0| 61 20 66 75 6e 63 74 69 | 6f 6e 2c 20 7b 5c 74 74 |a functi|on, {\tt|
|000028d0| 20 21 42 7d 0a 28 6e 6f | 74 20 61 20 73 70 65 63 | !B}.(no|t a spec|
|000028e0| 69 61 6c 20 66 6f 72 6d | 29 20 77 68 69 63 68 20 |ial form|) which |
|000028f0| 6d 61 79 20 64 6f 20 61 | 20 62 65 74 74 65 72 20 |may do a| better |
|00002900| 6a 6f 62 20 69 6e 20 73 | 6f 6d 65 20 63 69 72 63 |job in s|ome circ|
|00002910| 75 6d 73 74 61 6e 63 65 | 73 2c 0a 62 75 74 20 69 |umstance|s,.but i|
|00002920| 73 20 6d 6f 72 65 20 70 | 72 6f 6e 65 20 74 6f 20 |s more p|rone to |
|00002930| 69 6e 66 69 6e 69 74 65 | 20 6c 6f 6f 70 73 2e 0a |infinite| loops..|
|00002940| 0a 5c 73 65 63 74 69 6f | 6e 7b 53 74 61 72 74 2d |.\sectio|n{Start-|
|00002950| 55 70 20 43 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e |Up Confi|guration|
|00002960| 7d 0a 5c 66 65 65 6c 27 | 73 20 64 65 66 61 75 6c |}.\feel'|s defaul|
|00002970| 74 20 73 74 61 72 74 69 | 6e 67 20 62 65 68 61 76 |t starti|ng behav|
|00002980| 69 6f 75 72 20 6d 61 79 | 20 62 65 20 6d 6f 64 69 |iour may| be modi|
|00002990| 66 69 65 64 20 69 6e 20 | 74 77 6f 20 77 61 79 73 |fied in |two ways|
|000029a0| 20 5c 6c 64 6f 74 73 0a | 0a 5c 62 65 67 69 6e 7b | \ldots.|.\begin{|
|000029b0| 64 65 73 63 72 69 70 74 | 69 6f 6e 7d 0a 5c 69 74 |descript|ion}.\it|
|000029c0| 65 6d 5b 43 6f 6d 6d 61 | 6e 64 20 4c 69 6e 65 20 |em[Comma|nd Line |
|000029d0| 41 72 67 75 6d 65 6e 74 | 73 5d 0a 20 20 54 68 65 |Argument|s]. The|
|000029e0| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 72 65 63 | interpr|eter rec|
|000029f0| 6f 67 6e 69 73 65 73 20 | 61 20 6e 75 6d 62 65 72 |ognises |a number|
|00002a00| 20 6f 66 20 63 6f 6d 6d | 61 6e 64 20 6c 69 6e 65 | of comm|and line|
|00002a10| 20 61 72 67 75 6d 65 6e | 74 73 20 77 68 69 63 68 | argumen|ts which|
|00002a20| 0a 20 20 61 72 65 20 62 | 61 73 69 63 61 6c 6c 79 |. are b|asically|
|00002a30| 20 2d 68 65 61 70 2c 20 | 2d 73 74 61 63 6b 2d 73 | -heap, |-stack-s|
|00002a40| 70 61 63 65 20 61 6e 64 | 20 2d 64 6f 20 62 75 74 |pace and| -do but|
|00002a50| 20 79 6f 75 20 64 69 64 | 6e 27 74 20 77 61 6e 74 | you did|n't want|
|00002a60| 20 74 6f 20 6b 6e 6f 77 | 20 74 68 61 74 2e 20 41 | to know| that. A|
|00002a70| 63 74 75 61 6c 6c 79 3a | 0a 0a 20 20 5c 62 65 67 |ctually:|.. \beg|
|00002a80| 69 6e 7b 64 65 73 63 72 | 69 70 74 69 6f 6e 7d 0a |in{descr|iption}.|
|00002a90| 20 20 5c 69 74 65 6d 5b | 2d 68 65 61 70 20 24 6e | \item[|-heap $n|
|00002aa0| 24 5d 20 54 68 65 20 73 | 69 7a 65 20 6f 66 20 68 |$] The s|ize of h|
|00002ab0| 65 61 70 20 74 6f 20 75 | 73 65 20 28 69 6e 20 6d |eap to u|se (in m|
|00002ac0| 65 67 61 62 79 74 65 73 | 20 69 66 20 24 6e 3c 35 |egabytes| if $n<5|
|00002ad0| 30 24 2c 20 65 6c 73 65 | 0a 20 20 20 20 62 79 74 |0$, else|. byt|
|00002ae0| 65 73 29 2e 20 46 65 65 | 6c 20 6e 65 65 64 73 20 |es). Fee|l needs |
|00002af0| 61 74 20 6c 65 61 73 74 | 20 61 20 31 2e 35 20 6d |at least| a 1.5 m|
|00002b00| 65 67 20 68 65 61 70 2e | 0a 20 20 5c 69 74 65 6d |eg heap.|. \item|
|00002b10| 5b 2d 64 6f 20 24 63 6d | 64 73 24 5d 20 41 20 6c |[-do $cm|ds$] A l|
|00002b20| 69 73 74 20 6f 66 20 74 | 68 69 6e 67 73 20 74 6f |ist of t|hings to|
|00002b30| 20 64 6f 20 6f 6e 20 73 | 74 61 72 74 75 70 0a 20 | do on s|tartup. |
|00002b40| 20 5c 69 74 65 6d 5b 2d | 73 74 61 63 6b 2d 73 70 | \item[-|stack-sp|
|00002b50| 61 63 65 20 24 6e 24 5d | 20 41 6d 6f 75 6e 74 20 |ace $n$]| Amount |
|00002b60| 6f 66 20 73 74 6f 72 61 | 67 65 20 74 6f 20 61 6c |of stora|ge to al|
|00002b70| 6c 6f 63 61 74 65 20 66 | 6f 72 20 73 74 61 63 6b |locate f|or stack|
|00002b80| 73 20 61 6e 64 0a 20 20 | 20 20 73 74 61 74 69 63 |s and. | static|
|00002b90| 20 64 61 74 61 2e 20 54 | 68 69 73 20 64 65 66 61 | data. T|his defa|
|00002ba0| 75 6c 74 73 20 74 6f 20 | 31 2c 20 62 75 74 20 73 |ults to |1, but s|
|00002bb0| 68 6f 75 6c 64 20 62 65 | 20 6d 6f 72 65 20 66 6f |hould be| more fo|
|00002bc0| 72 20 70 72 6f 67 72 61 | 6d 73 0a 20 20 20 20 74 |r progra|ms. t|
|00002bd0| 68 61 74 20 75 73 65 20 | 74 68 72 65 61 64 73 2e |hat use |threads.|
|00002be0| 0a 20 20 5c 69 74 65 6d | 5b 2d 62 6f 6f 74 5d 20 |. \item|[-boot] |
|00002bf0| 4e 61 6d 65 20 6f 66 20 | 62 79 74 65 63 6f 64 65 |Name of |bytecode|
|00002c00| 20 69 6d 61 67 65 20 66 | 69 6c 65 20 74 6f 20 6c | image f|ile to l|
|00002c10| 6f 61 64 2e 20 53 65 65 | 20 6c 61 74 65 72 0a 20 |oad. See| later. |
|00002c20| 20 5c 69 74 65 6d 5b 2d | 6d 61 70 5d 20 50 72 6f | \item[-|map] Pro|
|00002c30| 64 75 63 65 20 62 79 74 | 65 63 6f 64 65 20 6d 61 |duce byt|ecode ma|
|00002c40| 70 2e 20 53 65 65 20 6c | 61 74 65 72 2e 0a 20 20 |p. See l|ater.. |
|00002c50| 5c 69 74 65 6d 5b 2d 70 | 72 6f 63 73 20 24 6e 24 |\item[-p|rocs $n$|
|00002c60| 5d 20 53 74 61 72 74 20 | 75 70 20 75 73 69 6e 67 |] Start |up using|
|00002c70| 20 6e 20 70 72 6f 63 65 | 73 73 6f 72 73 2e 20 57 | n proce|ssors. W|
|00002c80| 6f 72 6b 73 20 69 6e 20 | 53 79 73 74 65 6d 56 0a |orks in |SystemV.|
|00002c90| 20 20 20 20 63 6f 6e 66 | 69 67 75 72 61 74 69 6f | conf|iguratio|
|00002ca0| 6e 20 6f 6e 6c 79 2e 0a | 20 20 5c 69 74 65 6d 5b |n only..| \item[|
|00002cb0| 2d 73 74 61 63 6b 2d 73 | 69 7a 65 5d 20 54 68 65 |-stack-s|ize] The|
|00002cc0| 20 73 69 7a 65 20 6f 66 | 20 74 68 65 20 69 6e 74 | size of| the int|
|00002cd0| 65 72 70 72 65 74 65 72 | 20 73 74 61 63 6b 2e 20 |erpreter| stack. |
|00002ce0| 44 65 66 61 75 6c 74 20 | 33 32 2c 0a 20 20 20 20 |Default |32,. |
|00002cf0| 6d 61 78 20 69 73 20 36 | 34 2e 20 69 74 20 73 68 |max is 6|4. it sh|
|00002d00| 6f 75 6c 64 20 6e 6f 74 | 65 20 62 65 20 6e 65 63 |ould not|e be nec|
|00002d10| 65 73 73 61 72 79 20 74 | 6f 20 63 68 61 6e 67 65 |essary t|o change|
|00002d20| 20 74 68 69 73 20 75 6e | 6c 65 73 73 20 79 6f 75 | this un|less you|
|00002d30| 72 0a 20 20 20 20 70 72 | 6f 67 72 61 6d 20 73 74 |r. pr|ogram st|
|00002d40| 6f 70 73 20 77 69 74 68 | 20 61 20 73 74 61 63 6b |ops with| a stack|
|00002d50| 2d 6f 76 65 72 66 6c 6f | 77 20 6d 65 73 73 61 67 |-overflo|w messag|
|00002d60| 65 2e 20 42 65 77 61 72 | 65 20 74 68 61 74 20 61 |e. Bewar|e that a|
|00002d70| 6e 0a 20 20 20 20 69 6e | 66 69 6e 69 74 65 20 6e |n. in|finite n|
|00002d80| 6f 6e 2d 74 61 69 6c 20 | 72 65 63 75 72 73 69 6f |on-tail |recursio|
|00002d90| 6e 20 70 72 6f 62 6c 65 | 6d 20 6d 61 79 20 61 6c |n proble|m may al|
|00002da0| 73 6f 20 74 72 69 67 67 | 65 72 20 74 68 69 73 20 |so trigg|er this |
|00002db0| 6d 65 73 73 61 67 65 2e | 0a 20 20 5c 65 6e 64 7b |message.|. \end{|
|00002dc0| 64 65 73 63 72 69 70 74 | 69 6f 6e 7d 0a 0a 5c 69 |descript|ion}..\i|
|00002dd0| 74 65 6d 5b 41 20 43 6f | 6e 66 69 67 75 72 61 74 |tem[A Co|nfigurat|
|00002de0| 69 6f 6e 20 46 69 6c 65 | 5d 0a 20 20 48 61 76 69 |ion File|]. Havi|
|00002df0| 6e 67 20 66 69 72 73 74 | 20 70 72 6f 63 65 73 73 |ng first| process|
|00002e00| 65 64 20 69 74 73 20 63 | 6f 6d 6d 61 6e 64 20 6c |ed its c|ommand l|
|00002e10| 69 6e 65 20 61 72 67 75 | 6d 65 6e 74 73 2c 20 5c |ine argu|ments, \|
|00002e20| 66 65 65 6c 5c 20 74 68 | 65 6e 20 6c 6f 6f 6b 73 |feel\ th|en looks|
|00002e30| 0a 20 20 66 6f 72 20 61 | 20 66 69 6c 65 20 63 61 |. for a| file ca|
|00002e40| 6c 6c 65 64 20 7b 5c 74 | 74 20 2e 66 65 65 6c 72 |lled {\t|t .feelr|
|00002e50| 63 7d 20 69 6e 20 74 68 | 65 20 7b 5c 74 74 20 5c |c} in th|e {\tt \|
|00002e60| 24 48 4f 4d 45 7d 20 64 | 69 72 65 63 74 6f 72 79 |$HOME} d|irectory|
|00002e70| 20 6f 66 20 74 68 65 0a | 20 20 75 73 65 72 5c 66 | of the.| user\f|
|00002e80| 6f 6f 74 6e 6f 74 65 7b | 4c 69 6b 65 6c 79 20 74 |ootnote{|Likely t|
|00002e90| 6f 20 62 65 20 65 6c 73 | 65 77 68 65 72 65 20 6f |o be els|ewhere o|
|00002ea0| 6e 20 6e 6f 6e 2d 55 4e | 49 58 20 73 79 73 74 65 |n non-UN|IX syste|
|00002eb0| 6d 73 7d 2e 20 20 49 66 | 20 66 6f 75 6e 64 2c 0a |ms}. If| found,.|
|00002ec0| 20 20 74 68 65 20 66 69 | 6c 65 20 69 73 20 72 65 | the fi|le is re|
|00002ed0| 61 64 20 61 6e 64 20 74 | 68 65 20 65 78 70 72 65 |ad and t|he expre|
|00002ee0| 73 73 69 6f 6e 73 20 77 | 69 74 68 69 6e 20 65 78 |ssions w|ithin ex|
|00002ef0| 65 63 75 74 65 64 20 61 | 73 20 69 66 20 65 6e 74 |ecuted a|s if ent|
|00002f00| 65 72 65 64 20 61 74 0a | 20 20 74 6f 70 20 6c 65 |ered at.| top le|
|00002f10| 76 65 6c 2e 0a 0a 5c 65 | 6e 64 7b 64 65 73 63 72 |vel...\e|nd{descr|
|00002f20| 69 70 74 69 6f 6e 7d 0a | 0a 5c 73 65 63 74 69 6f |iption}.|.\sectio|
|00002f30| 6e 7b 4f 62 6a 65 63 74 | 73 7d 0a 54 68 65 20 5c |n{Object|s}.The \|
|00002f40| 65 75 6c 69 73 70 5c 20 | 6f 62 6a 65 63 74 20 73 |eulisp\ |object s|
|00002f50| 79 73 74 65 6d 20 69 73 | 20 63 61 6c 6c 65 64 20 |ystem is| called |
|00002f60| 5c 74 65 6c 6f 73 2e 20 | 20 45 76 65 72 79 20 64 |\telos. | Every d|
|00002f70| 61 74 61 20 69 74 65 6d | 20 69 6e 0a 5c 65 75 6c |ata item| in.\eul|
|00002f80| 69 73 70 5c 20 69 73 20 | 70 61 72 74 20 6f 66 20 |isp\ is |part of |
|00002f90| 74 68 65 20 63 6c 61 73 | 73 20 68 69 65 72 61 72 |the clas|s hierar|
|00002fa0| 63 68 79 2e 20 20 53 69 | 6d 70 6c 65 20 63 6c 61 |chy. Si|mple cla|
|00002fb0| 73 73 65 73 20 63 61 6e | 20 62 65 0a 64 65 66 69 |sses can| be.defi|
|00002fc0| 6e 65 64 20 62 79 20 7b | 5c 74 74 20 64 65 66 73 |ned by {|\tt defs|
|00002fd0| 74 72 75 63 74 7d 2c 20 | 6d 6f 72 65 20 63 6f 6d |truct}, |more com|
|00002fe0| 70 6c 65 78 20 63 6c 61 | 73 73 65 73 20 77 69 74 |plex cla|sses wit|
|00002ff0| 68 20 7b 5c 74 74 20 64 | 65 66 63 6c 61 73 73 7d |h {\tt d|efclass}|
|00003000| 2e 0a 54 68 65 72 65 20 | 69 73 20 6e 6f 20 6d 65 |..There |is no me|
|00003010| 73 73 61 67 65 20 73 65 | 6e 64 20 70 72 69 6d 69 |ssage se|nd primi|
|00003020| 74 69 76 65 20 69 6e 20 | 5c 65 75 6c 69 73 70 2c |tive in |\eulisp,|
|00003030| 20 69 6e 73 74 65 61 64 | 20 67 65 6e 65 72 69 63 | instead| generic|
|00003040| 0a 66 75 6e 63 74 69 6f | 6e 73 20 61 72 65 20 75 |.functio|ns are u|
|00003050| 73 65 64 2e 20 20 5c 74 | 65 6c 6f 73 5c 20 68 61 |sed. \t|elos\ ha|
|00003060| 73 20 62 65 65 6e 20 64 | 65 73 69 67 6e 65 64 20 |s been d|esigned |
|00003070| 74 6f 20 6f 66 66 65 72 | 0a 70 72 6f 67 72 61 6d |to offer|.program|
|00003080| 6d 61 62 69 6c 69 74 79 | 2c 20 65 66 66 69 63 69 |mability|, effici|
|00003090| 65 6e 63 79 20 61 6e 64 | 20 66 6c 65 78 69 62 69 |ency and| flexibi|
|000030a0| 6c 69 74 79 20 61 6e 64 | 20 74 68 65 20 6e 65 78 |lity and| the nex|
|000030b0| 74 20 74 68 72 65 65 0a | 73 75 62 73 65 63 74 69 |t three.|subsecti|
|000030c0| 6f 6e 73 20 61 74 74 65 | 6d 70 74 20 74 6f 20 69 |ons atte|mpt to i|
|000030d0| 6c 6c 75 73 74 72 61 74 | 65 20 74 68 65 20 6b 69 |llustrat|e the ki|
|000030e0| 6e 64 73 20 6f 66 20 74 | 68 69 6e 67 73 20 79 6f |nds of t|hings yo|
|000030f0| 75 20 63 61 6e 20 64 6f | 20 77 69 74 68 0a 69 74 |u can do| with.it|
|00003100| 20 62 79 20 6d 65 61 6e | 73 20 6f 66 20 61 20 66 | by mean|s of a f|
|00003110| 65 77 20 65 78 61 6d 70 | 6c 65 73 2e 0a 0a 5c 73 |ew examp|les...\s|
|00003120| 75 62 73 65 63 74 69 6f | 6e 7b 47 65 6e 65 72 69 |ubsectio|n{Generi|
|00003130| 63 20 46 75 6e 63 74 69 | 6f 6e 73 7d 0a 59 6f 75 |c Functi|ons}.You|
|00003140| 20 73 65 65 2c 20 69 74 | 27 73 20 6c 69 6b 65 20 | see, it|'s like |
|00003150| 74 68 69 73 5c 64 6f 74 | 73 5c 66 6f 6f 74 6e 6f |this\dot|s\footno|
|00003160| 74 65 7b 74 6f 20 71 75 | 6f 74 65 20 4b 65 69 74 |te{to qu|ote Keit|
|00003170| 68 7d 0a 0a 5c 73 75 62 | 73 75 62 73 65 63 74 69 |h}..\sub|subsecti|
|00003180| 6f 6e 7b 55 6e 69 76 61 | 72 69 61 74 65 20 70 6f |on{Univa|riate po|
|00003190| 6c 79 6e 6f 6d 69 61 6c | 73 20 6f 76 65 72 20 74 |lynomial|s over t|
|000031a0| 68 65 20 69 6e 74 65 67 | 65 72 73 7d 0a 57 65 20 |he integ|ers}.We |
|000031b0| 73 74 61 72 74 20 77 69 | 74 68 20 61 20 70 6f 6c |start wi|th a pol|
|000031c0| 79 6e 6f 6d 69 61 6c 20 | 73 74 72 75 63 74 75 72 |ynomial |structur|
|000031d0| 65 3a 20 74 68 69 73 20 | 69 73 20 61 20 73 69 6e |e: this |is a sin|
|000031e0| 67 6c 65 20 74 65 72 6d | 2c 20 77 69 74 68 20 61 |gle term|, with a|
|000031f0| 0a 72 65 64 75 63 74 75 | 6d 20 74 68 61 74 20 69 |.reductu|m that i|
|00003200| 73 20 74 68 65 20 72 65 | 73 74 20 6f 66 20 74 68 |s the re|st of th|
|00003210| 65 20 70 6f 6c 79 6e 6f | 6d 69 61 6c 2e 20 41 20 |e polyno|mial. A |
|00003220| 72 65 64 75 63 74 75 6d | 20 74 68 61 74 20 69 73 |reductum| that is|
|00003230| 20 61 6e 0a 69 6e 74 65 | 67 65 72 20 6d 61 72 6b | an.inte|ger mark|
|00003240| 73 20 74 68 65 20 65 6e | 64 20 6f 66 20 74 68 65 |s the en|d of the|
|00003250| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 2e 20 20 41 20 | polynom|ial. A |
|00003260| 74 65 72 6d 20 63 6f 6e | 73 69 73 74 73 20 6f 66 |term con|sists of|
|00003270| 20 74 68 65 0a 6c 65 61 | 64 69 6e 67 20 64 65 67 | the.lea|ding deg|
|00003280| 72 65 65 20 61 6e 64 20 | 74 68 65 20 6c 65 61 64 |ree and |the lead|
|00003290| 69 6e 67 20 63 6f 65 66 | 66 69 63 69 65 6e 74 2e |ing coef|ficient.|
|000032a0| 0a 5c 62 65 67 69 6e 6c | 69 73 70 0a 28 64 65 66 |.\beginl|isp.(def|
|000032b0| 63 6c 61 73 73 20 3c 70 | 6f 6c 79 6e 6f 6d 69 61 |class <p|olynomia|
|000032c0| 6c 3e 20 28 3c 6e 75 6d | 62 65 72 3e 29 20 0a 20 |l> (<num|ber>) . |
|000032d0| 20 28 28 6c 64 65 67 20 | 61 63 63 65 73 73 6f 72 | ((ldeg |accessor|
|000032e0| 20 6c 64 65 67 20 69 6e | 69 74 61 72 67 20 6c 64 | ldeg in|itarg ld|
|000032f0| 65 67 20 69 6e 69 74 66 | 6f 72 6d 20 31 29 0a 20 |eg initf|orm 1). |
|00003300| 20 28 6c 63 20 61 63 63 | 65 73 73 6f 72 20 6c 63 | (lc acc|essor lc|
|00003310| 20 69 6e 69 74 61 72 67 | 20 6c 63 20 69 6e 69 74 | initarg| lc init|
|00003320| 66 6f 72 6d 20 31 29 20 | 0a 20 20 28 72 65 64 20 |form 1) |. (red |
|00003330| 61 63 63 65 73 73 6f 72 | 20 72 65 64 20 69 6e 69 |accessor| red ini|
|00003340| 74 61 72 67 20 72 65 64 | 20 69 6e 69 74 66 6f 72 |targ red| initfor|
|00003350| 6d 20 30 29 29 0a 63 6f | 6e 73 74 72 75 63 74 6f |m 0)).co|nstructo|
|00003360| 72 20 6d 61 6b 65 2d 70 | 6f 6c 79 6e 6f 6d 69 61 |r make-p|olynomia|
|00003370| 6c 29 0a 5c 65 6e 64 6c | 69 73 70 0a 0a 57 65 20 |l).\endl|isp..We |
|00003380| 64 65 66 69 6e 65 20 61 | 20 6d 65 74 68 6f 64 20 |define a| method |
|00003390| 6f 6e 20 7b 5c 74 74 20 | 65 71 75 61 6c 7d 20 73 |on {\tt |equal} s|
|000033a0| 6f 20 77 65 20 63 61 6e | 20 63 68 65 63 6b 20 69 |o we can| check i|
|000033b0| 66 20 74 77 6f 20 70 6f | 6c 79 6e 6f 6d 69 61 6c |f two po|lynomial|
|000033c0| 73 0a 61 72 65 20 74 68 | 65 20 73 61 6d 65 2e 20 |s.are th|e same. |
|000033d0| 4e 6f 74 69 63 65 20 77 | 65 20 64 6f 20 6e 6f 74 |Notice w|e do not|
|000033e0| 20 68 61 76 65 20 74 6f | 20 63 68 65 63 6b 20 66 | have to| check f|
|000033f0| 6f 72 20 74 68 65 20 62 | 6f 74 74 6f 6d 69 6e 67 |or the b|ottoming|
|00003400| 2d 6f 75 74 20 6f 66 0a | 74 68 65 20 72 65 63 75 |-out of.|the recu|
|00003410| 72 73 69 6f 6e 20 6f 6e | 20 74 68 65 20 72 65 64 |rsion on| the red|
|00003420| 75 63 74 61 3a 20 74 68 | 65 20 67 65 6e 65 72 69 |ucta: th|e generi|
|00003430| 63 20 6e 61 74 75 72 65 | 20 6f 66 20 7b 5c 74 74 |c nature| of {\tt|
|00003440| 20 65 71 75 61 6c 7d 0a | 65 6e 73 75 72 65 73 20 | equal}.|ensures |
|00003450| 74 68 61 74 20 77 68 65 | 6e 20 77 65 20 67 65 74 |that whe|n we get|
|00003460| 20 74 6f 20 74 68 65 20 | 65 6e 64 20 6f 66 20 61 | to the |end of a|
|00003470| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 28 61 6e 64 | polynom|ial (and|
|00003480| 20 77 65 20 68 61 76 65 | 20 61 6e 0a 69 6e 74 65 | we have| an.inte|
|00003490| 67 65 72 20 61 73 20 61 | 20 72 65 64 75 63 74 75 |ger as a| reductu|
|000034a0| 6d 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 61 20 |m rather| than a |
|000034b0| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 29 20 61 20 64 69 |polynomi|al) a di|
|000034c0| 66 66 65 72 65 6e 74 20 | 6d 65 74 68 6f 64 20 69 |fferent |method i|
|000034d0| 73 0a 63 61 6c 6c 65 64 | 2e 20 20 54 68 69 73 20 |s.called|. This |
|000034e0| 72 65 6c 69 65 73 20 6f | 6e 20 74 68 65 20 66 61 |relies o|n the fa|
|000034f0| 63 74 20 74 68 61 74 20 | 65 71 75 61 6c 2d 6d 65 |ct that |equal-me|
|00003500| 74 68 6f 64 73 20 66 6f | 72 20 28 69 6e 74 2c 20 |thods fo|r (int, |
|00003510| 70 6f 6c 79 29 0a 61 6e | 64 20 28 70 6f 6c 79 2c |poly).an|d (poly,|
|00003520| 20 69 6e 74 29 20 64 6f | 20 6e 6f 74 20 65 78 69 | int) do| not exi|
|00003530| 73 74 3a 20 74 68 65 20 | 67 65 6e 65 72 69 63 20 |st: the |generic |
|00003540| 66 75 6e 63 74 69 6f 6e | 20 64 69 73 63 72 69 6d |function| discrim|
|00003550| 69 6e 61 74 6f 72 0a 63 | 68 6f 6f 73 65 73 20 74 |inator.c|hooses t|
|00003560| 68 65 20 6e 65 61 72 65 | 73 74 20 61 70 70 6c 69 |he neare|st appli|
|00003570| 63 61 62 6c 65 20 6d 65 | 74 68 6f 64 20 6f 6e 20 |cable me|thod on |
|00003580| 7b 5c 74 74 20 65 71 75 | 61 6c 7d 2c 20 77 68 69 |{\tt equ|al}, whi|
|00003590| 63 68 20 69 6e 20 74 68 | 69 73 0a 63 61 73 65 20 |ch in th|is.case |
|000035a0| 69 73 20 28 7b 5c 74 74 | 20 6f 62 6a 65 63 74 7d |is ({\tt| object}|
|000035b0| 2c 20 7b 5c 74 74 20 6f | 62 6a 65 63 74 7d 29 2e |, {\tt o|bject}).|
|000035c0| 20 54 68 69 73 20 6d 65 | 74 68 6f 64 20 72 65 74 | This me|thod ret|
|000035d0| 75 72 6e 73 20 7b 5c 74 | 74 20 28 29 7d 20 28 61 |urns {\t|t ()} (a|
|000035e0| 73 0a 74 68 65 20 61 72 | 67 73 20 63 61 6e 6e 6f |s.the ar|gs canno|
|000035f0| 74 20 62 65 20 7b 5c 74 | 74 20 65 71 7d 29 2c 20 |t be {\t|t eq}), |
|00003600| 77 68 69 63 68 20 69 73 | 20 6a 75 73 74 20 77 68 |which is| just wh|
|00003610| 61 74 20 77 65 20 77 61 | 6e 74 2e 0a 0a 5c 62 65 |at we wa|nt...\be|
|00003620| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 28 64 |gin{verb|atim}.(d|
|00003630| 65 66 6d 65 74 68 6f 64 | 20 65 71 75 61 6c 20 28 |efmethod| equal (|
|00003640| 28 70 20 3c 70 6f 6c 79 | 6e 6f 6d 69 61 6c 3e 29 |(p <poly|nomial>)|
|00003650| 20 28 71 20 3c 70 6f 6c | 79 6e 6f 6d 69 61 6c 3e | (q <pol|ynomial>|
|00003660| 29 29 20 0a 20 20 28 61 | 6e 64 20 28 65 71 75 61 |)) . (a|nd (equa|
|00003670| 6c 20 28 6c 64 65 67 20 | 70 29 20 28 6c 64 65 67 |l (ldeg |p) (ldeg|
|00003680| 20 71 29 29 0a 20 20 20 | 20 20 20 20 28 65 71 75 | q)). | (equ|
|00003690| 61 6c 20 28 6c 63 20 70 | 29 20 28 6c 63 20 71 29 |al (lc p|) (lc q)|
|000036a0| 29 20 28 65 71 75 61 6c | 20 28 72 65 64 20 70 29 |) (equal| (red p)|
|000036b0| 20 28 72 65 64 20 71 29 | 29 29 29 0a 5c 65 6e 64 | (red q)|))).\end|
|000036c0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 0a 57 65 20 6e |{verbati|m}..We n|
|000036d0| 6f 77 20 6e 65 65 64 20 | 73 6f 6d 65 20 6f 70 65 |ow need |some ope|
|000036e0| 72 61 74 69 6f 6e 73 20 | 6f 6e 20 74 68 69 73 20 |rations |on this |
|000036f0| 6e 65 77 20 74 79 70 65 | 2e 20 49 66 20 77 65 20 |new type|. If we |
|00003700| 61 72 65 20 74 72 79 69 | 6e 67 20 74 6f 20 61 64 |are tryi|ng to ad|
|00003710| 64 0a 70 6f 6c 79 6e 6f | 6d 69 61 6c 73 20 74 6f |d.polyno|mials to|
|00003720| 20 69 6e 74 65 67 65 72 | 73 2c 20 77 65 20 77 6f | integer|s, we wo|
|00003730| 75 6c 64 20 6c 69 6b 65 | 20 73 6f 6d 65 20 6d 65 |uld like| some me|
|00003740| 74 68 6f 64 20 66 6f 72 | 20 63 6f 6e 76 65 72 74 |thod for| convert|
|00003750| 69 6e 67 0a 62 65 74 77 | 65 65 6e 20 69 6e 74 65 |ing.betw|een inte|
|00003760| 67 65 72 73 20 61 6e 64 | 20 70 6f 6c 79 6e 6f 6d |gers and| polynom|
|00003770| 69 61 6c 73 2e 20 57 65 | 20 20 75 73 65 20 74 68 |ials. We| use th|
|00003780| 65 20 66 75 6e 63 74 69 | 6f 6e 20 7b 5c 74 74 0a |e functi|on {\tt.|
|00003790| 6c 69 66 74 2d 6e 75 6d | 62 65 72 73 7d 20 74 6f |lift-num|bers} to|
|000037a0| 20 64 6f 20 74 68 69 73 | 2e 0a 5c 62 65 67 69 6e | do this|..\begin|
|000037b0| 6c 69 73 70 0a 20 20 28 | 64 65 66 6d 65 74 68 6f |lisp. (|defmetho|
|000037c0| 64 20 6c 69 66 74 2d 6e | 75 6d 62 65 72 73 20 28 |d lift-n|umbers (|
|000037d0| 28 69 20 3c 69 6e 74 65 | 67 65 72 3e 29 20 28 70 |(i <inte|ger>) (p|
|000037e0| 20 3c 70 6f 6c 79 6e 6f | 6d 69 61 6c 3e 29 29 0a | <polyno|mial>)).|
|000037f0| 20 20 20 20 3c 70 6f 6c | 79 6e 6f 6d 69 61 6c 3e | <pol|ynomial>|
|00003800| 29 0a 0a 20 20 28 64 65 | 66 6d 65 74 68 6f 64 20 |).. (de|fmethod |
|00003810| 6c 69 66 74 2d 6e 75 6d | 62 65 72 73 20 28 28 70 |lift-num|bers ((p|
|00003820| 20 3c 70 6f 6c 79 6e 6f | 6d 69 61 6c 3e 29 20 28 | <polyno|mial>) (|
|00003830| 69 20 3c 69 6e 74 65 67 | 65 72 3e 29 29 0a 20 20 |i <integ|er>)). |
|00003840| 20 20 3c 70 6f 6c 79 6e | 6f 6d 69 61 6c 3e 29 0a | <polyn|omial>).|
|00003850| 0a 20 20 28 64 65 66 6d | 65 74 68 6f 64 20 28 63 |. (defm|ethod (c|
|00003860| 6f 6e 76 65 72 74 65 72 | 20 3c 70 6f 6c 79 6e 6f |onverter| <polyno|
|00003870| 6d 69 61 6c 3e 29 20 28 | 28 78 20 3c 69 6e 74 65 |mial>) (|(x <inte|
|00003880| 67 65 72 3e 29 29 0a 20 | 20 20 20 28 6d 61 6b 65 |ger>)). | (make|
|00003890| 2d 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 27 6c 63 20 |-polynom|ial 'lc |
|000038a0| 78 20 27 6c 64 65 67 20 | 30 29 29 0a 5c 65 6e 64 |x 'ldeg |0)).\end|
|000038b0| 6c 69 73 70 0a 4e 6f 77 | 20 69 66 20 77 65 20 63 |lisp.Now| if we c|
|000038c0| 61 6c 6c 20 61 6e 79 20 | 6f 70 65 72 61 74 69 6f |all any |operatio|
|000038d0| 6e 20 77 69 74 68 20 61 | 20 70 6f 6c 79 6e 6f 6d |n with a| polynom|
|000038e0| 69 61 6c 20 61 6e 64 20 | 61 6e 20 69 6e 74 65 67 |ial and |an integ|
|000038f0| 65 72 2c 20 74 68 65 0a | 69 6e 74 65 67 65 72 20 |er, the.|integer |
|00003900| 69 73 20 6c 69 66 74 65 | 64 20 74 6f 20 63 6c 61 |is lifte|d to cla|
|00003910| 73 73 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 2c 20 61 |ss polyn|omial, a|
|00003920| 6e 64 20 74 68 65 20 6f | 70 65 72 61 74 69 6f 6e |nd the o|peration|
|00003930| 20 70 72 6f 63 65 65 64 | 73 20 61 73 0a 6e 6f 72 | proceed|s as.nor|
|00003940| 6d 61 6c 2e 20 46 6f 72 | 20 74 77 6f 20 70 6f 6c |mal. For| two pol|
|00003950| 79 6e 6f 6d 69 61 6c 73 | 2c 20 74 68 65 20 6d 65 |ynomials|, the me|
|00003960| 74 68 6f 64 20 69 73 20 | 65 61 73 79 2e 20 41 20 |thod is |easy. A |
|00003970| 6d 69 6e 6f 72 20 77 72 | 69 6e 6b 6c 65 20 69 73 |minor wr|inkle is|
|00003980| 0a 77 68 65 6e 20 74 68 | 65 20 6c 65 61 64 69 6e |.when th|e leadin|
|00003990| 67 20 74 65 72 6d 73 20 | 63 61 6e 63 65 6c 3a 20 |g terms |cancel: |
|000039a0| 77 65 20 6d 75 73 74 20 | 74 61 6b 65 20 63 61 72 |we must |take car|
|000039b0| 65 20 6e 6f 74 20 74 6f | 20 68 61 76 65 20 61 20 |e not to| have a |
|000039c0| 6c 65 61 64 69 6e 67 0a | 63 6f 65 66 66 69 63 69 |leading.|coeffici|
|000039d0| 65 6e 74 20 6f 66 20 30 | 2e 0a 5c 62 65 67 69 6e |ent of 0|..\begin|
|000039e0| 6c 69 73 70 0a 20 20 28 | 64 65 66 6d 65 74 68 6f |lisp. (|defmetho|
|000039f0| 64 20 62 69 6e 61 72 79 | 2d 70 6c 75 73 20 28 28 |d binary|-plus ((|
|00003a00| 70 20 3c 70 6f 6c 79 6e | 6f 6d 69 61 6c 3e 29 20 |p <polyn|omial>) |
|00003a10| 28 71 20 3c 70 6f 6c 79 | 6e 6f 6d 69 61 6c 3e 29 |(q <poly|nomial>)|
|00003a20| 29 20 0a 20 20 28 63 6f | 6e 64 20 28 28 3d 20 28 |) . (co|nd ((= (|
|00003a30| 6c 64 65 67 20 70 29 20 | 28 6c 64 65 67 20 71 29 |ldeg p) |(ldeg q)|
|00003a40| 29 0a 20 20 20 20 28 6c | 65 74 20 28 28 73 75 6d |). (l|et ((sum|
|00003a50| 20 28 62 69 6e 61 72 79 | 2d 70 6c 75 73 20 28 6c | (binary|-plus (l|
|00003a60| 63 20 70 29 20 28 6c 63 | 20 71 29 29 29 29 0a 20 |c p) (lc| q)))). |
|00003a70| 20 20 20 20 20 28 69 66 | 20 28 7a 65 72 6f 70 20 | (if| (zerop |
|00003a80| 73 75 6d 29 20 28 62 69 | 6e 61 72 79 2d 70 6c 75 |sum) (bi|nary-plu|
|00003a90| 73 20 28 72 65 64 20 70 | 29 20 28 72 65 64 20 71 |s (red p|) (red q|
|00003aa0| 29 29 0a 20 20 20 20 20 | 20 20 20 28 6d 61 6b 65 |)). | (make|
|00003ab0| 2d 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 27 6c 64 65 |-polynom|ial 'lde|
|00003ac0| 67 20 28 6c 64 65 67 20 | 70 29 20 27 6c 63 20 73 |g (ldeg |p) 'lc s|
|00003ad0| 75 6d 20 27 72 65 64 20 | 0a 20 20 20 20 20 20 20 |um 'red |. |
|00003ae0| 20 28 62 69 6e 61 72 79 | 2d 70 6c 75 73 20 28 72 | (binary|-plus (r|
|00003af0| 65 64 20 70 29 20 28 72 | 65 64 20 71 29 29 29 29 |ed p) (r|ed q))))|
|00003b00| 29 29 20 0a 20 20 20 28 | 28 3c 20 28 6c 64 65 67 |)) . (|(< (ldeg|
|00003b10| 20 70 29 20 28 6c 64 65 | 67 20 71 29 29 0a 20 20 | p) (lde|g q)). |
|00003b20| 20 20 28 6d 61 6b 65 2d | 70 6f 6c 79 6e 6f 6d 69 | (make-|polynomi|
|00003b30| 61 6c 20 27 6c 64 65 67 | 20 28 6c 64 65 67 20 71 |al 'ldeg| (ldeg q|
|00003b40| 29 20 27 6c 63 20 28 6c | 63 20 71 29 20 0a 20 20 |) 'lc (l|c q) . |
|00003b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003b60| 20 20 20 27 72 65 64 20 | 28 62 69 6e 61 72 79 2d | 'red |(binary-|
|00003b70| 70 6c 75 73 20 70 20 28 | 72 65 64 20 71 29 29 29 |plus p (|red q)))|
|00003b80| 29 0a 20 20 20 28 74 20 | 28 6d 61 6b 65 2d 70 6f |). (t |(make-po|
|00003b90| 6c 79 6e 6f 6d 69 61 6c | 20 27 6c 64 65 67 20 28 |lynomial| 'ldeg (|
|00003ba0| 6c 64 65 67 20 70 29 20 | 27 6c 63 20 28 6c 63 20 |ldeg p) |'lc (lc |
|00003bb0| 70 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |p). | |
|00003bc0| 20 20 20 20 20 20 20 20 | 20 20 27 72 65 64 20 28 | | 'red (|
|00003bd0| 62 69 6e 61 72 79 2d 70 | 6c 75 73 20 28 72 65 64 |binary-p|lus (red|
|00003be0| 20 70 29 20 71 29 29 29 | 29 29 0a 0a 20 20 28 64 | p) q)))|)).. (d|
|00003bf0| 65 66 6d 65 74 68 6f 64 | 20 62 69 6e 61 72 79 2d |efmethod| binary-|
|00003c00| 64 69 66 66 65 72 65 6e | 63 65 20 2e 2e 2e 0a 5c |differen|ce ....\|
|00003c10| 65 6e 64 6c 69 73 70 0a | 61 6e 64 20 73 6f 20 6f |endlisp.|and so o|
|00003c20| 6e 20 66 6f 72 20 74 68 | 65 20 6f 74 68 65 72 20 |n for th|e other |
|00003c30| 61 72 69 74 68 6d 65 74 | 69 63 20 6f 70 65 72 61 |arithmet|ic opera|
|00003c40| 74 69 6f 6e 73 2e 20 41 | 6c 73 6f 20 77 65 20 77 |tions. A|lso we w|
|00003c50| 6f 75 6c 64 20 70 75 74 | 20 6e 65 77 0a 6d 65 74 |ould put| new.met|
|00003c60| 68 6f 64 73 20 6f 6e 20 | 7b 5c 74 74 20 67 65 6e |hods on |{\tt gen|
|00003c70| 65 72 69 63 2d 70 72 69 | 6e 7d 20 61 6e 64 20 7b |eric-pri|n} and {|
|00003c80| 5c 74 74 20 67 65 6e 65 | 72 69 63 2d 77 72 69 74 |\tt gene|ric-writ|
|00003c90| 65 7d 20 74 6f 20 70 72 | 69 6e 74 20 6f 75 74 20 |e} to pr|int out |
|00003ca0| 74 68 65 0a 76 61 6c 75 | 65 73 20 6f 66 20 70 6f |the.valu|es of po|
|00003cb0| 6c 79 6e 6f 6d 69 61 6c | 73 20 75 73 69 6e 67 20 |lynomial|s using |
|00003cc0| 61 20 73 75 69 74 61 62 | 6c 65 20 73 79 6e 74 61 |a suitab|le synta|
|00003cd0| 78 2e 0a 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |x...\sub|section{|
|00003ce0| 43 6c 61 73 73 65 73 7d | 0a 43 6c 61 73 73 65 73 |Classes}|.Classes|
|00003cf0| 20 69 6e 20 5c 65 75 6c | 69 73 70 5c 20 61 72 65 | in \eul|isp\ are|
|00003d00| 20 6e 6f 74 20 73 74 61 | 74 69 63 20 69 74 65 6d | not sta|tic item|
|00003d10| 73 3a 20 74 68 65 79 20 | 63 61 6e 20 62 65 20 64 |s: they |can be d|
|00003d20| 65 66 69 6e 65 64 20 61 | 6e 64 0a 63 72 65 61 74 |efined a|nd.creat|
|00003d30| 65 64 20 64 79 6e 61 6d | 69 63 61 6c 6c 79 20 6a |ed dynam|ically j|
|00003d40| 75 73 74 20 61 73 20 61 | 6e 79 20 6f 74 68 65 72 |ust as a|ny other|
|00003d50| 20 74 79 70 65 20 69 6e | 20 74 68 65 20 73 79 73 | type in| the sys|
|00003d60| 74 65 6d 2e 20 54 68 65 | 0a 66 6f 6c 6c 6f 77 69 |tem. The|.followi|
|00003d70| 6e 67 20 65 78 61 6d 70 | 6c 65 20 64 65 6d 6f 6e |ng examp|le demon|
|00003d80| 73 74 72 61 74 65 73 20 | 74 68 69 73 20 62 79 20 |strates |this by |
|00003d90| 64 65 66 69 6e 69 6e 67 | 20 61 20 63 6c 61 73 73 |defining| a class|
|00003da0| 20 77 68 6f 73 65 0a 69 | 6e 73 74 61 6e 63 65 73 | whose.i|nstances|
|00003db0| 20 61 72 65 20 74 68 65 | 6d 73 65 6c 76 65 73 20 | are the|mselves |
|00003dc0| 63 6c 61 73 73 65 73 2c | 20 77 68 6f 73 65 20 69 |classes,| whose i|
|00003dd0| 6e 73 74 61 6e 63 65 73 | 20 61 72 65 20 6d 6f 64 |nstances| are mod|
|00003de0| 75 6c 61 72 20 6e 75 6d | 62 65 72 73 2e 0a 54 68 |ular num|bers..Th|
|00003df0| 65 20 69 6e 74 65 72 6d | 65 64 69 61 74 65 20 63 |e interm|ediate c|
|00003e00| 6c 61 73 73 65 73 20 61 | 72 65 20 70 61 72 61 6d |lasses a|re param|
|00003e10| 65 74 65 72 69 73 65 64 | 20 62 79 20 61 6e 20 69 |eterised| by an i|
|00003e20| 6e 74 65 67 65 72 2c 20 | 77 68 69 63 68 20 61 72 |nteger, |which ar|
|00003e30| 65 0a 74 68 65 20 62 61 | 73 65 73 20 66 6f 72 20 |e.the ba|ses for |
|00003e40| 74 68 65 20 6d 6f 64 75 | 6c 61 72 20 72 69 6e 67 |the modu|lar ring|
|00003e50| 73 2e 20 20 54 68 69 73 | 20 61 6c 73 6f 20 69 6c |s. This| also il|
|00003e60| 6c 75 73 74 72 61 74 65 | 73 20 74 68 65 20 75 73 |lustrate|s the us|
|00003e70| 65 20 6f 66 0a 6d 65 74 | 61 63 6c 61 73 73 65 73 |e of.met|aclasses|
|00003e80| 2c 20 77 68 69 63 68 20 | 63 6f 6e 74 72 6f 6c 20 |, which |control |
|00003e90| 74 68 65 20 73 74 72 75 | 63 74 75 72 65 20 6f 66 |the stru|cture of|
|00003ea0| 20 63 6c 61 73 73 65 73 | 2e 0a 0a 57 65 20 63 72 | classes|...We cr|
|00003eb0| 65 61 74 65 20 61 20 6d | 65 74 61 63 6c 61 73 73 |eate a m|etaclass|
|00003ec0| 20 7b 5c 74 74 20 3c 7a | 6d 6f 64 6e 3e 7d 20 77 | {\tt <z|modn>} w|
|00003ed0| 68 69 63 68 20 69 73 20 | 74 68 65 20 63 6c 61 73 |hich is |the clas|
|00003ee0| 73 20 6f 66 20 74 68 65 | 20 63 6c 61 73 73 65 73 |s of the| classes|
|00003ef0| 0a 5c 63 6c 61 73 73 6e | 61 6d 65 7b 5a 6d 6f 64 |.\classn|ame{Zmod|
|00003f00| 33 7d 2c 20 5c 63 6c 61 | 73 73 6e 61 6d 65 7b 5a |3}, \cla|ssname{Z|
|00003f10| 6d 6f 64 35 7d 2c 20 5c | 63 6c 61 73 73 6e 61 6d |mod5}, \|classnam|
|00003f20| 65 7b 5a 6d 6f 64 37 7d | 2c 20 65 74 63 2e 0a 5c |e{Zmod7}|, etc..\|
|00003f30| 62 65 67 69 6e 6c 69 73 | 70 0a 20 20 28 64 65 66 |beginlis|p. (def|
|00003f40| 63 6c 61 73 73 20 3c 7a | 6d 6f 64 6e 2d 63 6c 61 |class <z|modn-cla|
|00003f50| 73 73 3e 20 28 3c 63 6c | 61 73 73 3e 29 0a 20 20 |ss> (<cl|ass>). |
|00003f60| 20 20 28 28 6e 20 69 6e | 69 74 61 72 67 20 6e 20 | ((n in|itarg n |
|00003f70| 72 65 61 64 65 72 20 7a | 6d 6f 64 6e 2d 63 6c 61 |reader z|modn-cla|
|00003f80| 73 73 2d 6e 29 29 0a 20 | 20 20 20 6d 65 74 61 63 |ss-n)). | metac|
|00003f90| 6c 61 73 73 20 3c 63 6c | 61 73 73 3e 29 0a 5c 65 |lass <cl|ass>).\e|
|00003fa0| 6e 64 6c 69 73 70 0a 0a | 54 68 69 73 20 77 69 6c |ndlisp..|This wil|
|00003fb0| 6c 20 62 65 20 61 20 64 | 69 72 65 63 74 20 73 75 |l be a d|irect su|
|00003fc0| 62 63 6c 61 73 73 20 6f | 66 20 7b 5c 74 74 20 63 |bclass o|f {\tt c|
|00003fd0| 6c 61 73 73 7d 2c 20 61 | 6e 64 20 73 6f 20 77 69 |lass}, a|nd so wi|
|00003fe0| 6c 6c 20 69 6e 68 65 72 | 69 74 20 69 74 73 0a 6d |ll inher|it its.m|
|00003ff0| 65 74 68 6f 64 73 2c 20 | 69 6e 20 70 61 72 74 69 |ethods, |in parti|
|00004000| 63 75 6c 61 72 20 74 68 | 65 20 61 62 69 6c 69 74 |cular th|e abilit|
|00004010| 79 20 74 6f 20 63 72 65 | 61 74 65 20 73 75 62 63 |y to cre|ate subc|
|00004020| 6c 61 73 73 65 73 20 77 | 68 69 63 68 20 61 72 65 |lasses w|hich are|
|00004030| 0a 74 68 65 6d 73 65 6c | 76 65 73 20 63 6c 61 73 |.themsel|ves clas|
|00004040| 73 65 73 2e 20 20 54 68 | 65 20 69 6e 73 74 61 6e |ses. Th|e instan|
|00004050| 63 65 73 20 6f 66 20 74 | 68 69 73 20 63 6c 61 73 |ces of t|his clas|
|00004060| 73 20 77 69 6c 6c 20 68 | 61 76 65 20 61 20 73 6c |s will h|ave a sl|
|00004070| 6f 74 0a 6e 61 6d 65 64 | 20 7b 5c 74 74 20 6e 7d |ot.named| {\tt n}|
|00004080| 2c 20 77 68 69 63 68 20 | 77 69 6c 6c 20 62 65 20 |, which |will be |
|00004090| 74 68 65 20 6d 6f 64 75 | 6c 61 72 20 62 61 73 65 |the modu|lar base|
|000040a0| 2e 0a 0a 4e 6f 77 20 77 | 65 20 64 65 66 69 6e 65 |...Now w|e define|
|000040b0| 20 61 20 73 75 70 65 72 | 63 6c 61 73 73 20 66 6f | a super|class fo|
|000040c0| 72 20 61 6c 6c 20 6f 66 | 20 69 74 73 20 69 6e 73 |r all of| its ins|
|000040d0| 74 61 6e 63 65 73 2c 20 | 74 6f 20 70 6c 61 63 65 |tances, |to place|
|000040e0| 20 74 68 65 6d 20 69 6e | 0a 74 68 65 69 72 20 6f | them in|.their o|
|000040f0| 77 6e 20 73 75 62 2d 68 | 69 65 72 61 72 63 68 79 |wn sub-h|ierarchy|
|00004100| 20 6f 66 20 74 68 65 20 | 63 6c 61 73 73 20 67 72 | of the |class gr|
|00004110| 61 70 68 2e 20 20 54 68 | 69 73 20 63 6c 61 73 73 |aph. Th|is class|
|00004120| 20 68 61 73 20 61 6e 0a | 69 6e 73 74 61 6e 63 65 | has an.|instance|
|00004130| 20 76 61 72 69 61 62 6c | 65 20 7b 5c 74 74 20 7a | variabl|e {\tt z|
|00004140| 7d 2c 20 73 69 6e 63 65 | 20 74 68 65 20 69 6e 73 |}, since| the ins|
|00004150| 74 61 6e 63 65 73 20 6f | 66 20 69 74 73 20 73 75 |tances o|f its su|
|00004160| 62 63 6c 61 73 73 65 73 | 20 61 72 65 0a 74 68 65 |bclasses| are.the|
|00004170| 20 66 75 6c 6c 79 20 69 | 6e 73 74 61 6e 74 69 61 | fully i|nstantia|
|00004180| 74 65 64 20 6d 6f 64 75 | 6c 61 72 20 6e 75 6d 62 |ted modu|lar numb|
|00004190| 65 72 73 2e 0a 5c 62 65 | 67 69 6e 6c 69 73 70 0a |ers..\be|ginlisp.|
|000041a0| 20 20 28 64 65 66 63 6c | 61 73 73 20 3c 7a 6d 6f | (defcl|ass <zmo|
|000041b0| 64 6e 2d 6f 62 6a 65 63 | 74 3e 20 28 3c 6e 75 6d |dn-objec|t> (<num|
|000041c0| 62 65 72 3e 29 0a 20 20 | 20 20 28 28 7a 20 61 63 |ber>). | ((z ac|
|000041d0| 63 65 73 73 6f 72 20 7a | 6d 6f 64 6e 2d 7a 29 29 |cessor z|modn-z))|
|000041e0| 0a 20 20 20 20 6d 65 74 | 61 63 6c 61 73 73 20 3c |. met|aclass <|
|000041f0| 7a 6d 6f 64 6e 2d 63 6c | 61 73 73 3e 29 0a 5c 65 |zmodn-cl|ass>).\e|
|00004200| 6e 64 6c 69 73 70 0a 54 | 68 65 20 6d 65 74 61 63 |ndlisp.T|he metac|
|00004210| 6c 61 73 73 20 6f 66 20 | 74 68 65 20 69 6e 73 74 |lass of |the inst|
|00004220| 61 6e 63 65 73 20 6f 66 | 20 7b 5c 74 74 20 7a 6d |ances of| {\tt zm|
|00004230| 6f 64 6e 2d 6f 62 6a 65 | 63 74 7d 20 69 73 20 64 |odn-obje|ct} is d|
|00004240| 65 66 69 6e 65 64 20 74 | 6f 20 62 65 0a 74 68 65 |efined t|o be.the|
|00004250| 20 63 6c 61 73 73 20 7b | 5c 74 74 20 7a 6d 6f 64 | class {|\tt zmod|
|00004260| 6e 2d 63 6c 61 73 73 7d | 2e 20 54 68 75 73 20 74 |n-class}|. Thus t|
|00004270| 68 65 20 73 74 72 75 63 | 74 75 72 65 20 6f 66 20 |he struc|ture of |
|00004280| 74 68 65 20 69 6e 73 74 | 61 6e 63 65 73 20 28 74 |the inst|ances (t|
|00004290| 68 65 0a 63 6c 61 73 73 | 65 73 20 7b 5c 74 74 20 |he.class|es {\tt |
|000042a0| 5a 6d 6f 64 35 7d 2c 20 | 65 74 63 2e 29 20 69 73 |Zmod5}, |etc.) is|
|000042b0| 20 64 65 74 65 72 6d 69 | 6e 65 64 20 62 79 20 7b | determi|ned by {|
|000042c0| 5c 74 74 20 7a 6d 6f 64 | 6e 2d 63 6c 61 73 73 7d |\tt zmod|n-class}|
|000042d0| 2e 0a 0a 54 68 65 20 63 | 6f 6e 73 74 72 75 63 74 |...The c|onstruct|
|000042e0| 6f 72 20 66 6f 72 20 74 | 68 65 20 69 6e 73 74 61 |or for t|he insta|
|000042f0| 6e 63 65 73 20 6f 66 20 | 7b 5c 74 74 20 7a 6d 6f |nces of |{\tt zmo|
|00004300| 64 6e 2d 63 6c 61 73 73 | 7d 20 28 74 68 65 20 6d |dn-class|} (the m|
|00004310| 65 74 61 63 6c 61 73 73 | 29 0a 63 6f 75 6c 64 20 |etaclass|).could |
|00004320| 62 65 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |be the f|ollowing|
|00004330| 3a 0a 5c 62 65 67 69 6e | 6c 69 73 70 0a 20 28 64 |:.\begin|lisp. (d|
|00004340| 65 66 75 6e 20 6d 61 6b | 65 2d 7a 6d 6f 64 6e 2d |efun mak|e-zmodn-|
|00004350| 63 6c 61 73 73 20 28 6e | 29 0a 20 20 20 20 28 6d |class (n|). (m|
|00004360| 61 6b 65 20 3c 7a 6d 6f | 64 6e 2d 63 6c 61 73 73 |ake <zmo|dn-class|
|00004370| 3e 0a 09 20 20 27 64 69 | 72 65 63 74 2d 73 75 70 |>.. 'di|rect-sup|
|00004380| 65 72 63 6c 61 73 73 65 | 73 20 28 6c 69 73 74 20 |erclasse|s (list |
|00004390| 3c 7a 6d 6f 64 6e 2d 6f | 62 6a 65 63 74 3e 29 0a |<zmodn-o|bject>).|
|000043a0| 09 20 20 27 6e 61 6d 65 | 20 28 6d 61 6b 65 2d 73 |. 'name| (make-s|
|000043b0| 79 6d 62 6f 6c 20 28 66 | 6f 72 6d 61 74 20 6e 69 |ymbol (f|ormat ni|
|000043c0| 6c 20 22 3c 7a 6d 6f 64 | 2d 7e 61 3e 22 20 6e 29 |l "<zmod|-~a>" n)|
|000043d0| 29 0a 09 20 20 27 6e 20 | 6e 29 29 0a 5c 65 6e 64 |).. 'n |n)).\end|
|000043e0| 6c 69 73 70 0a 54 68 65 | 20 7b 5c 74 74 20 6d 61 |lisp.The| {\tt ma|
|000043f0| 6b 65 2d 69 6e 73 74 61 | 6e 63 65 7d 20 72 65 71 |ke-insta|nce} req|
|00004400| 75 69 72 65 73 20 76 61 | 6c 75 65 73 20 66 6f 72 |uires va|lues for|
|00004410| 20 74 68 65 20 73 6c 6f | 74 73 20 69 6e 20 7b 5c | the slo|ts in {\|
|00004420| 74 74 0a 7a 6d 6f 64 6e | 2d 63 6c 61 73 73 7d 2c |tt.zmodn|-class},|
|00004430| 20 77 68 69 63 68 20 69 | 6e 63 6c 75 64 65 20 7b | which i|nclude {|
|00004440| 5c 74 74 20 6e 7d 20 28 | 74 68 65 20 73 6c 6f 74 |\tt n} (|the slot|
|00004450| 20 77 65 20 64 65 66 69 | 6e 65 64 29 2c 20 61 6e | we defi|ned), an|
|00004460| 64 20 7b 5c 74 74 0a 64 | 69 72 65 63 74 2d 73 75 |d {\tt.d|irect-su|
|00004470| 70 65 72 63 6c 61 73 73 | 65 73 7d 2c 20 61 20 73 |perclass|es}, a s|
|00004480| 6c 6f 74 20 69 6e 68 65 | 72 69 74 65 64 20 66 72 |lot inhe|rited fr|
|00004490| 6f 6d 20 7b 5c 74 74 20 | 63 6c 61 73 73 7d 2e 0a |om {\tt |class}..|
|000044a0| 0a 49 66 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 |.If you |want to |
|000044b0| 61 76 6f 69 64 20 63 72 | 65 61 74 69 6e 67 20 64 |avoid cr|eating d|
|000044c0| 75 70 6c 69 63 61 74 65 | 20 7b 5c 74 74 20 7a 6d |uplicate| {\tt zm|
|000044d0| 6f 64 6e 7d 20 63 6c 61 | 73 73 65 73 20 77 69 74 |odn} cla|sses wit|
|000044e0| 68 20 74 68 65 0a 73 61 | 6d 65 20 4e 2c 20 74 72 |h the.sa|me N, tr|
|000044f0| 79 20 74 68 69 73 20 64 | 65 66 69 6e 69 74 69 6f |y this d|efinitio|
|00004500| 6e 20 69 6e 73 74 65 61 | 64 3a 0a 5c 62 65 67 69 |n instea|d:.\begi|
|00004510| 6e 6c 69 73 70 0a 0a 20 | 20 28 64 65 66 63 6f 6e |nlisp.. | (defcon|
|00004520| 73 74 61 6e 74 20 2a 7a | 6d 6f 64 6e 2d 74 61 62 |stant *z|modn-tab|
|00004530| 6c 65 2a 0a 20 20 20 20 | 20 28 6d 61 6b 65 20 3c |le*. | (make <|
|00004540| 74 61 62 6c 65 3e 20 27 | 63 6f 6d 70 61 72 61 74 |table> '|comparat|
|00004550| 6f 72 20 3d 20 27 68 61 | 73 68 2d 66 75 6e 63 74 |or = 'ha|sh-funct|
|00004560| 69 6f 6e 20 67 65 6e 65 | 72 69 63 2d 68 61 73 68 |ion gene|ric-hash|
|00004570| 29 29 0a 0a 20 20 28 64 | 65 66 75 6e 20 6d 61 6b |)).. (d|efun mak|
|00004580| 65 2d 7a 6d 6f 64 6e 2d | 63 6c 61 73 73 32 20 28 |e-zmodn-|class2 (|
|00004590| 6e 29 0a 20 20 20 20 28 | 6f 72 20 28 74 61 62 6c |n). (|or (tabl|
|000045a0| 65 2d 72 65 66 20 2a 7a | 6d 6f 64 6e 2d 74 61 62 |e-ref *z|modn-tab|
|000045b0| 6c 65 2a 20 6e 29 0a 09 | 28 6c 65 74 20 28 28 63 |le* n)..|(let ((c|
|000045c0| 6c 20 28 6d 61 6b 65 2d | 7a 6d 6f 64 6e 2d 63 6c |l (make-|zmodn-cl|
|000045d0| 61 73 73 20 6e 29 29 29 | 0a 09 20 20 28 28 73 65 |ass n)))|.. ((se|
|000045e0| 74 74 65 72 20 74 61 62 | 6c 65 2d 72 65 66 29 20 |tter tab|le-ref) |
|000045f0| 2a 7a 6d 6f 64 6e 2d 74 | 61 62 6c 65 2a 20 6e 20 |*zmodn-t|able* n |
|00004600| 63 6c 29 0a 09 20 20 63 | 6c 29 29 29 0a 5c 65 6e |cl).. c|l))).\en|
|00004610| 64 6c 69 73 70 0a 0a 54 | 68 65 20 66 75 6e 63 74 |dlisp..T|he funct|
|00004620| 69 6f 6e 20 74 6f 20 63 | 72 65 61 74 65 20 74 68 |ion to c|reate th|
|00004630| 65 20 6d 6f 64 75 6c 61 | 72 20 6f 62 6a 65 63 74 |e modula|r object|
|00004640| 73 20 74 68 65 6d 73 65 | 6c 76 65 73 20 63 6f 75 |s themse|lves cou|
|00004650| 6c 64 20 62 65 20 64 65 | 66 69 6e 65 64 0a 61 73 |ld be de|fined.as|
|00004660| 20 66 6f 6c 6c 6f 77 73 | 3a 0a 5c 62 65 67 69 6e | follows|:.\begin|
|00004670| 6c 69 73 70 0a 20 20 28 | 64 65 66 75 6e 20 6d 61 |lisp. (|defun ma|
|00004680| 6b 65 2d 6d 6f 64 75 6c | 61 72 2d 6e 75 6d 62 65 |ke-modul|ar-numbe|
|00004690| 72 20 28 7a 20 6e 29 20 | 0a 20 20 20 20 20 28 6d |r (z n) |. (m|
|000046a0| 61 6b 65 2d 69 6e 73 74 | 61 6e 63 65 20 28 6d 61 |ake-inst|ance (ma|
|000046b0| 6b 65 2d 7a 6d 6f 64 6e | 2d 63 6c 61 73 73 32 20 |ke-zmodn|-class2 |
|000046c0| 6e 29 20 27 7a 20 7a 29 | 29 0a 5c 65 6e 64 6c 69 |n) 'z z)|).\endli|
|000046d0| 73 70 0a 4e 6f 74 65 20 | 74 68 61 74 20 74 68 69 |sp.Note |that thi|
|000046e0| 73 20 69 6d 70 6c 65 6d | 65 6e 61 74 61 74 69 6f |s implem|enatatio|
|000046f0| 6e 20 67 75 61 72 65 6e | 74 65 65 73 20 74 68 61 |n guaren|tees tha|
|00004700| 74 20 74 68 65 20 6e 75 | 6d 62 65 72 20 69 73 20 |t the nu|mber is |
|00004710| 6f 66 20 74 68 65 0a 61 | 70 70 72 6f 70 72 69 61 |of the.a|ppropria|
|00004720| 74 65 20 72 61 6e 67 65 | 3a 0a 5c 62 65 67 69 6e |te range|:.\begin|
|00004730| 6c 69 73 70 0a 20 20 28 | 64 65 66 6d 65 74 68 6f |lisp. (|defmetho|
|00004740| 64 20 69 6e 69 74 69 61 | 6c 69 7a 65 20 28 28 70 |d initia|lize ((p|
|00004750| 72 6f 74 6f 20 3c 7a 6d | 6f 64 6e 2d 6f 62 6a 65 |roto <zm|odn-obje|
|00004760| 63 74 3e 29 20 6c 73 74 | 29 0a 20 20 20 20 28 6c |ct>) lst|). (l|
|00004770| 65 74 20 28 28 69 20 28 | 63 61 6c 6c 2d 6e 65 78 |et ((i (|call-nex|
|00004780| 74 2d 6d 65 74 68 6f 64 | 29 29 29 0a 20 20 20 20 |t-method|))). |
|00004790| 20 20 28 28 73 65 74 74 | 65 72 20 7a 6d 6f 64 6e | ((sett|er zmodn|
|000047a0| 2d 7a 29 20 69 20 0a 20 | 20 20 20 20 20 20 28 72 |-z) i . | (r|
|000047b0| 65 6d 61 69 6e 64 65 72 | 20 28 73 63 61 6e 2d 61 |emainder| (scan-a|
|000047c0| 72 67 73 20 27 7a 20 6c | 73 74 20 72 65 71 75 69 |rgs 'z l|st requi|
|000047d0| 72 65 64 2d 61 72 67 75 | 6d 65 6e 74 29 20 0a 09 |red-argu|ment) ..|
|000047e0| 09 20 20 28 7a 6d 6f 64 | 6e 2d 6e 20 69 29 29 29 |. (zmod|n-n i)))|
|000047f0| 0a 20 20 20 20 20 20 69 | 29 29 0a 5c 65 6e 64 6c |. i|)).\endl|
|00004800| 69 73 70 0a 20 20 0a 47 | 65 74 74 69 6e 67 20 7b |isp. .G|etting {|
|00004810| 5c 74 74 20 7a 7d 20 66 | 72 6f 6d 20 6f 6e 65 20 |\tt z} f|rom one |
|00004820| 6f 66 20 74 68 65 73 65 | 20 69 6e 73 74 61 6e 63 |of these| instanc|
|00004830| 65 73 20 69 73 20 61 6c | 72 65 61 64 79 20 64 65 |es is al|ready de|
|00004840| 66 69 6e 65 64 20 62 79 | 20 74 68 65 0a 72 65 61 |fined by| the.rea|
|00004850| 64 65 72 20 6f 6e 20 7b | 5c 74 74 20 7a 6d 6f 64 |der on {|\tt zmod|
|00004860| 6e 2d 6f 62 6a 65 63 74 | 7d 2e 20 20 47 65 74 74 |n-object|}. Gett|
|00004870| 69 6e 67 20 7b 5c 74 74 | 20 6e 7d 20 69 6e 76 6f |ing {\tt| n} invo|
|00004880| 6c 76 65 73 20 67 6f 69 | 6e 67 20 74 6f 20 74 68 |lves goi|ng to th|
|00004890| 65 0a 63 6c 61 73 73 2e | 20 20 4d 61 6b 69 6e 67 |e.class.| Making|
|000048a0| 20 74 68 69 73 20 61 76 | 61 69 6c 61 62 6c 65 20 | this av|ailable |
|000048b0| 66 72 6f 6d 20 69 6e 73 | 74 61 6e 63 65 73 20 6d |from ins|tances m|
|000048c0| 65 61 6e 73 20 64 65 66 | 69 6e 69 6e 67 20 74 68 |eans def|ining th|
|000048d0| 65 0a 66 6f 6c 6c 6f 77 | 69 6e 67 20 66 75 6e 63 |e.follow|ing func|
|000048e0| 74 69 6f 6e 3a 0a 5c 62 | 65 67 69 6e 6c 69 73 70 |tion:.\b|eginlisp|
|000048f0| 0a 20 20 28 64 65 66 67 | 65 6e 65 72 69 63 20 7a |. (defg|eneric z|
|00004900| 6d 6f 64 6e 2d 6e 20 28 | 6f 62 6a 29 29 0a 0a 20 |modn-n (|obj)).. |
|00004910| 20 20 28 64 65 66 6d 65 | 74 68 6f 64 20 7a 6d 6f | (defme|thod zmo|
|00004920| 64 6e 2d 6e 20 28 28 7a | 20 3c 7a 6d 6f 64 6e 2d |dn-n ((z| <zmodn-|
|00004930| 6f 62 6a 65 63 74 3e 29 | 29 0a 20 20 20 20 20 28 |object>)|). (|
|00004940| 7a 6d 6f 64 6e 2d 63 6c | 61 73 73 2d 6e 20 28 63 |zmodn-cl|ass-n (c|
|00004950| 6c 61 73 73 2d 6f 66 20 | 7a 29 29 29 0a 5c 65 6e |lass-of |z))).\en|
|00004960| 64 6c 69 73 70 0a 0a 4e | 65 78 74 2c 20 77 65 20 |dlisp..N|ext, we |
|00004970| 77 61 6e 74 20 74 6f 20 | 64 65 66 69 6e 65 20 73 |want to |define s|
|00004980| 6f 6d 65 20 73 69 6d 70 | 6c 65 20 61 72 69 74 68 |ome simp|le arith|
|00004990| 6d 65 74 69 63 20 6f 6e | 20 6d 6f 64 75 6c 61 72 |metic on| modular|
|000049a0| 20 6e 75 6d 62 65 72 73 | 2c 20 66 6f 72 0a 65 78 | numbers|, for.ex|
|000049b0| 61 6d 70 6c 65 2c 20 61 | 64 64 69 74 69 6f 6e 2e |ample, a|ddition.|
|000049c0| 20 48 6f 77 65 76 65 72 | 2c 20 74 68 69 73 20 6f | However|, this o|
|000049d0| 6e 6c 79 20 6d 61 6b 65 | 73 20 73 65 6e 73 65 20 |nly make|s sense |
|000049e0| 69 66 20 77 65 20 68 61 | 76 65 20 74 68 65 20 73 |if we ha|ve the s|
|000049f0| 61 6d 65 0a 6d 6f 64 75 | 6c 75 73 20 69 6e 20 62 |ame.modu|lus in b|
|00004a00| 6f 74 68 20 6f 66 20 74 | 68 65 20 73 75 6d 6d 61 |oth of t|he summa|
|00004a10| 6e 64 73 2e 0a 5c 62 65 | 67 69 6e 6c 69 73 70 0a |nds..\be|ginlisp.|
|00004a20| 20 20 28 64 65 66 75 6e | 20 63 6f 6d 70 61 74 69 | (defun| compati|
|00004a30| 62 6c 65 2d 6d 6f 64 75 | 6c 69 20 28 6e 20 6d 29 |ble-modu|li (n m)|
|00004a40| 20 28 69 66 20 28 3d 20 | 28 7a 6d 6f 64 6e 2d 6e | (if (= |(zmodn-n|
|00004a50| 20 6e 29 20 28 7a 6d 6f | 64 6e 2d 6e 20 6d 29 29 | n) (zmo|dn-n m))|
|00004a60| 20 74 0a 20 20 20 20 28 | 65 72 72 6f 72 20 22 69 | t. (|error "i|
|00004a70| 6e 63 6f 6d 70 61 74 69 | 62 6c 65 20 6d 6f 64 75 |ncompati|ble modu|
|00004a80| 6c 69 22 20 49 6e 74 65 | 72 6e 61 6c 2d 45 72 72 |li" Inte|rnal-Err|
|00004a90| 6f 72 29 29 29 0a 5c 65 | 6e 64 6c 69 73 70 0a 0a |or))).\e|ndlisp..|
|00004aa0| 57 65 20 64 65 66 69 6e | 65 20 61 20 6d 65 74 68 |We defin|e a meth|
|00004ab0| 6f 64 20 66 6f 72 20 61 | 64 64 69 74 69 6f 6e 20 |od for a|ddition |
|00004ac0| 6f 6e 20 7b 5c 74 74 20 | 3c 7a 6d 6f 64 6e 2d 6f |on {\tt |<zmodn-o|
|00004ad0| 62 6a 65 63 74 3e 7d 3a | 20 74 68 69 73 20 77 69 |bject>}:| this wi|
|00004ae0| 6c 6c 20 74 68 65 6e 0a | 62 65 20 69 6e 68 65 72 |ll then.|be inher|
|00004af0| 69 74 65 64 20 62 79 20 | 65 61 63 68 20 69 6e 73 |ited by |each ins|
|00004b00| 74 61 6e 63 65 2c 20 76 | 69 7a 2e 2c 20 74 68 65 |tance, v|iz., the|
|00004b10| 20 61 63 74 75 61 6c 20 | 72 69 6e 67 73 20 7b 5c | actual |rings {\|
|00004b20| 74 74 20 3c 7a 6d 6f 64 | 33 3e 7d 2c 0a 7b 5c 74 |tt <zmod|3>},.{\t|
|00004b30| 74 20 3c 7a 6d 6f 64 35 | 3e 7d 2c 20 61 6e 64 20 |t <zmod5|>}, and |
|00004b40| 73 6f 20 6f 6e 2e 0a 5c | 62 65 67 69 6e 6c 69 73 |so on..\|beginlis|
|00004b50| 70 0a 20 20 28 64 65 66 | 6d 65 74 68 6f 64 20 62 |p. (def|method b|
|00004b60| 69 6e 61 72 79 2d 70 6c | 75 73 20 28 28 6e 31 20 |inary-pl|us ((n1 |
|00004b70| 3c 7a 6d 6f 64 6e 2d 6f | 62 6a 65 63 74 3e 29 20 |<zmodn-o|bject>) |
|00004b80| 28 6e 32 20 3c 7a 6d 6f | 64 6e 2d 6f 62 6a 65 63 |(n2 <zmo|dn-objec|
|00004b90| 74 3e 29 29 20 0a 20 20 | 20 20 28 77 68 65 6e 20 |t>)) . | (when |
|00004ba0| 28 63 6f 6d 70 61 74 69 | 62 6c 65 2d 6d 6f 64 75 |(compati|ble-modu|
|00004bb0| 6c 69 20 6e 31 20 6e 32 | 29 20 0a 20 20 20 20 20 |li n1 n2|) . |
|00004bc0| 20 28 6d 61 6b 65 2d 6d | 6f 64 75 6c 61 72 2d 6e | (make-m|odular-n|
|00004bd0| 75 6d 62 65 72 20 28 2b | 20 28 7a 6d 6f 64 6e 2d |umber (+| (zmodn-|
|00004be0| 7a 20 69 29 20 28 7a 6d | 6f 64 6e 2d 7a 20 6a 29 |z i) (zm|odn-z j)|
|00004bf0| 29 20 0a 09 09 09 20 20 | 20 28 7a 6d 6f 64 6e 2d |) .... | (zmodn-|
|00004c00| 6e 20 69 29 29 29 29 0a | 5c 65 6e 64 6c 69 73 70 |n i)))).|\endlisp|
|00004c10| 0a 0a 57 65 20 63 61 6e | 20 61 64 64 20 61 20 6d |..We can| add a m|
|00004c20| 65 74 68 6f 64 20 74 6f | 20 74 68 65 20 70 72 69 |ethod to| the pri|
|00004c30| 6e 74 20 66 75 6e 63 74 | 69 6f 6e 20 74 6f 20 76 |nt funct|ion to v|
|00004c40| 69 65 77 20 6e 75 6d 62 | 65 72 73 20 70 72 65 74 |iew numb|ers pret|
|00004c50| 74 69 6c 79 0a 5c 62 65 | 67 69 6e 6c 69 73 70 0a |tily.\be|ginlisp.|
|00004c60| 20 20 28 64 65 66 6d 65 | 74 68 6f 64 20 67 65 6e | (defme|thod gen|
|00004c70| 65 72 69 63 2d 70 72 69 | 6e 20 28 28 6e 20 3c 7a |eric-pri|n ((n <z|
|00004c80| 6d 6f 64 6e 2d 6f 62 6a | 65 63 74 3e 29 20 73 29 |modn-obj|ect>) s)|
|00004c90| 20 0a 20 20 20 20 28 66 | 6f 72 6d 61 74 20 73 20 | . (f|ormat s |
|00004ca0| 22 7e 61 3c 6d 6f 64 20 | 7e 61 3e 22 20 28 7a 6d |"~a<mod |~a>" (zm|
|00004cb0| 6f 64 6e 2d 7a 20 6e 29 | 20 28 7a 6d 6f 64 6e 2d |odn-z n)| (zmodn-|
|00004cc0| 6e 20 6e 29 29 29 0a 5c | 65 6e 64 6c 69 73 70 0a |n n))).\|endlisp.|
|00004cd0| 0a 46 69 6e 61 6c 6c 79 | 2c 20 73 6f 6d 65 20 65 |.Finally|, some e|
|00004ce0| 78 61 6d 70 6c 65 73 20 | 6f 66 20 6e 75 6d 62 65 |xamples |of numbe|
|00004cf0| 72 73 0a 5c 62 65 67 69 | 6e 6c 69 73 70 0a 20 20 |rs.\begi|nlisp. |
|00004d00| 28 64 65 66 6c 6f 63 61 | 6c 20 7a 65 72 6f 35 20 |(defloca|l zero5 |
|00004d10| 28 6d 61 6b 65 2d 6d 6f | 64 75 6c 61 72 2d 6e 75 |(make-mo|dular-nu|
|00004d20| 6d 62 65 72 20 30 20 35 | 29 29 20 0a 20 20 28 64 |mber 0 5|)) . (d|
|00004d30| 65 66 6c 6f 63 61 6c 20 | 6f 6e 65 35 20 28 6d 61 |eflocal |one5 (ma|
|00004d40| 6b 65 2d 6d 6f 64 75 6c | 61 72 2d 6e 75 6d 62 65 |ke-modul|ar-numbe|
|00004d50| 72 20 31 20 35 29 29 0a | 20 20 28 64 65 66 6c 6f |r 1 5)).| (deflo|
|00004d60| 63 61 6c 20 74 77 6f 35 | 20 28 6d 61 6b 65 2d 6d |cal two5| (make-m|
|00004d70| 6f 64 75 6c 61 72 2d 6e | 75 6d 62 65 72 20 32 20 |odular-n|umber 2 |
|00004d80| 35 29 29 0a 20 20 28 64 | 65 66 6c 6f 63 61 6c 20 |5)). (d|eflocal |
|00004d90| 74 68 72 65 65 35 20 28 | 6d 61 6b 65 2d 6d 6f 64 |three5 (|make-mod|
|00004da0| 75 6c 61 72 2d 6e 75 6d | 62 65 72 20 33 20 35 29 |ular-num|ber 3 5)|
|00004db0| 29 0a 20 20 28 64 65 66 | 6c 6f 63 61 6c 20 66 6f |). (def|local fo|
|00004dc0| 75 72 35 20 28 6d 61 6b | 65 2d 6d 6f 64 75 6c 61 |ur5 (mak|e-modula|
|00004dd0| 72 2d 6e 75 6d 62 65 72 | 20 34 20 35 29 29 0a 20 |r-number| 4 5)). |
|00004de0| 20 28 64 65 66 6c 6f 63 | 61 6c 20 7a 65 72 6f 33 | (defloc|al zero3|
|00004df0| 20 28 6d 61 6b 65 2d 6d | 6f 64 75 6c 61 72 2d 6e | (make-m|odular-n|
|00004e00| 75 6d 62 65 72 20 30 20 | 33 29 29 20 0a 20 20 28 |umber 0 |3)) . (|
|00004e10| 64 65 66 6c 6f 63 61 6c | 20 6f 6e 65 33 20 28 6d |deflocal| one3 (m|
|00004e20| 61 6b 65 2d 6d 6f 64 75 | 6c 61 72 2d 6e 75 6d 62 |ake-modu|lar-numb|
|00004e30| 65 72 20 31 20 33 29 29 | 0a 20 20 28 64 65 66 6c |er 1 3))|. (defl|
|00004e40| 6f 63 61 6c 20 74 77 6f | 33 20 28 6d 61 6b 65 2d |ocal two|3 (make-|
|00004e50| 6d 6f 64 75 6c 61 72 2d | 6e 75 6d 62 65 72 20 32 |modular-|number 2|
|00004e60| 20 33 29 29 0a 5c 65 6e | 64 6c 69 73 70 0a 0a 4e | 3)).\en|dlisp..N|
|00004e70| 6f 77 20 69 66 20 77 65 | 20 74 72 79 20 61 6e 20 |ow if we| try an |
|00004e80| 61 64 64 69 74 69 6f 6e | 3a 0a 5c 62 65 67 69 6e |addition|:.\begin|
|00004e90| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 3e 20 28 2b 20 |{verbati|m}.> (+ |
|00004ea0| 74 77 6f 35 20 66 6f 75 | 72 35 29 0a 3c 20 31 3c |two5 fou|r5).< 1<|
|00004eb0| 6d 6f 64 20 35 3e 0a 5c | 65 6e 64 7b 76 65 72 62 |mod 5>.\|end{verb|
|00004ec0| 61 74 69 6d 7d 0a 57 65 | 20 64 69 64 6e 27 74 20 |atim}.We| didn't |
|00004ed0| 68 61 76 65 20 74 6f 20 | 73 70 65 63 69 66 79 20 |have to |specify |
|00004ee0| 61 20 70 6c 75 73 20 6d | 65 74 68 6f 64 20 66 6f |a plus m|ethod fo|
|00004ef0| 72 20 65 61 63 68 20 6d | 6f 64 75 6c 61 72 20 72 |r each m|odular r|
|00004f00| 69 6e 67 0a 69 6e 64 69 | 76 69 64 75 61 6c 6c 79 |ing.indi|vidually|
|00004f10| 3a 20 74 68 65 20 73 69 | 6e 67 6c 65 20 64 65 66 |: the si|ngle def|
|00004f20| 69 6e 69 74 69 6f 6e 20 | 6f 6e 20 74 68 65 20 73 |inition |on the s|
|00004f30| 75 70 65 72 63 6c 61 73 | 73 20 73 75 66 66 69 63 |uperclas|s suffic|
|00004f40| 65 73 2e 0a 0a 54 68 61 | 6e 6b 73 20 74 6f 20 48 |es...Tha|nks to H|
|00004f50| 61 72 6c 65 79 20 44 61 | 76 69 73 20 66 6f 72 20 |arley Da|vis for |
|00004f60| 68 65 6c 70 20 6f 6e 20 | 74 68 69 73 20 73 65 63 |help on |this sec|
|00004f70| 74 69 6f 6e 2e 0a 0a 5c | 73 75 62 73 65 63 74 69 |tion...\|subsecti|
|00004f80| 6f 6e 7b 53 6c 6f 74 20 | 44 65 73 63 72 69 70 74 |on{Slot |Descript|
|00004f90| 69 6f 6e 73 7d 0a 41 6e | 6f 74 68 65 72 20 61 73 |ions}.An|other as|
|00004fa0| 70 65 63 74 20 6f 66 20 | 74 68 65 20 70 72 6f 67 |pect of |the prog|
|00004fb0| 72 61 6d 6d 61 62 69 6c | 69 74 79 20 6f 66 20 5c |rammabil|ity of \|
|00004fc0| 74 65 6c 6f 73 5c 20 69 | 73 20 73 6c 6f 74 2d 64 |telos\ i|s slot-d|
|00004fd0| 65 73 63 72 69 70 74 69 | 6f 6e 73 2e 0a 54 68 69 |escripti|ons..Thi|
|00004fe0| 73 20 61 6c 6c 6f 77 73 | 20 74 68 65 20 75 73 65 |s allows| the use|
|00004ff0| 72 20 74 6f 20 63 6f 6e | 74 72 6f 6c 20 68 6f 77 |r to con|trol how|
|00005000| 20 74 68 65 20 73 6c 6f | 74 73 20 6f 66 20 61 20 | the slo|ts of a |
|00005010| 63 6c 61 73 73 20 61 72 | 65 20 61 63 63 65 73 73 |class ar|e access|
|00005020| 65 64 2e 0a 48 65 72 65 | 20 77 65 20 70 72 65 73 |ed..Here| we pres|
|00005030| 65 6e 74 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f |ent an e|xample o|
|00005040| 66 20 74 68 65 20 75 73 | 65 20 6f 66 20 73 6c 6f |f the us|e of slo|
|00005050| 74 2d 64 65 73 63 72 69 | 70 74 69 6f 6e 73 20 74 |t-descri|ptions t|
|00005060| 6f 20 70 72 6f 76 69 64 | 65 0a 61 20 63 6c 61 73 |o provid|e.a clas|
|00005070| 73 65 64 20 28 74 79 70 | 65 64 29 20 73 6c 6f 74 |sed (typ|ed) slot|
|00005080| 20 66 61 63 69 6c 69 74 | 79 2e 20 20 54 68 65 20 | facilit|y. The |
|00005090| 61 69 6d 20 69 73 20 74 | 6f 20 62 65 20 61 62 6c |aim is t|o be abl|
|000050a0| 65 20 74 6f 20 64 65 66 | 69 6e 65 20 61 0a 63 6c |e to def|ine a.cl|
|000050b0| 61 73 73 20 61 6e 64 2c | 20 61 74 20 74 68 65 20 |ass and,| at the |
|000050c0| 73 61 6d 65 20 74 69 6d | 65 2c 20 74 68 65 20 63 |same tim|e, the c|
|000050d0| 6c 61 73 73 20 6f 66 20 | 74 68 65 20 76 61 6c 75 |lass of |the valu|
|000050e0| 65 73 20 74 6f 20 62 65 | 20 61 73 73 6f 63 69 61 |es to be| associa|
|000050f0| 74 65 64 0a 77 69 74 68 | 20 61 20 67 69 76 65 6e |ted.with| a given|
|00005100| 20 73 6c 6f 74 2e 20 20 | 54 68 65 20 73 6f 6c 75 | slot. |The solu|
|00005110| 74 69 6f 6e 20 69 73 20 | 74 6f 20 64 65 66 69 6e |tion is |to defin|
|00005120| 65 20 61 20 6e 65 77 20 | 6b 69 6e 64 20 6f 66 0a |e a new |kind of.|
|00005130| 73 6c 6f 74 2d 64 65 73 | 63 72 69 70 74 69 6f 6e |slot-des|cription|
|00005140| 20 74 6f 20 76 65 72 69 | 66 79 20 74 68 61 74 20 | to veri|fy that |
|00005150| 6f 6e 6c 79 20 76 61 6c | 75 65 73 20 6f 66 20 74 |only val|ues of t|
|00005160| 68 65 20 63 6f 72 72 65 | 63 74 20 63 6c 61 73 73 |he corre|ct class|
|00005170| 20 61 72 65 0a 73 74 6f | 72 65 64 20 69 6e 20 74 | are.sto|red in t|
|00005180| 68 65 20 73 6c 6f 74 2e | 20 20 57 65 20 73 74 61 |he slot.| We sta|
|00005190| 72 74 20 62 79 20 64 65 | 66 69 6e 69 6e 67 20 61 |rt by de|fining a|
|000051a0| 20 6e 65 77 20 6b 69 6e | 64 20 6f 66 0a 73 6c 6f | new kin|d of.slo|
|000051b0| 74 2d 64 65 73 63 72 69 | 70 74 69 6f 6e 20 7b 5c |t-descri|ption {\|
|000051c0| 74 74 20 3c 63 6c 61 73 | 73 65 64 5c 2d 2d 6c 6f |tt <clas|sed\--lo|
|000051d0| 63 61 6c 5c 2d 2d 73 6c | 6f 74 2d 64 65 73 63 72 |cal\--sl|ot-descr|
|000051e0| 69 70 74 69 6f 6e 3e 7d | 2e 0a 0a 5c 62 65 67 69 |iption>}|...\begi|
|000051f0| 6e 6c 69 73 70 0a 20 28 | 64 65 66 63 6c 61 73 73 |nlisp. (|defclass|
|00005200| 20 3c 63 6c 61 73 73 65 | 64 2d 6c 6f 63 61 6c 2d | <classe|d-local-|
|00005210| 73 6c 6f 74 2d 64 65 73 | 63 72 69 70 74 69 6f 6e |slot-des|cription|
|00005220| 3e 20 28 3c 6c 6f 63 61 | 6c 2d 73 6c 6f 74 2d 64 |> (<loca|l-slot-d|
|00005230| 65 73 63 72 69 70 74 69 | 6f 6e 3e 29 0a 20 20 20 |escripti|on>). |
|00005240| 20 28 28 63 6f 6e 74 65 | 6e 74 73 2d 63 6c 61 73 | ((conte|nts-clas|
|00005250| 73 20 69 6e 69 74 66 6f | 72 6d 20 3c 6f 62 6a 65 |s initfo|rm <obje|
|00005260| 63 74 3e 20 69 6e 69 74 | 61 72 67 20 63 6f 6e 74 |ct> init|arg cont|
|00005270| 65 6e 74 73 2d 63 6c 61 | 73 73 0a 09 09 20 20 20 |ents-cla|ss... |
|00005280| 20 20 72 65 61 64 65 72 | 20 63 6c 61 73 73 65 64 | reader| classed|
|00005290| 2d 6c 6f 63 61 6c 2d 73 | 6c 6f 74 2d 64 65 73 63 |-local-s|lot-desc|
|000052a0| 72 69 70 74 69 6f 6e 2d | 63 6f 6e 74 65 6e 74 73 |ription-|contents|
|000052b0| 2d 63 6c 61 73 73 29 29 | 0a 20 20 20 20 6d 65 74 |-class))|. met|
|000052c0| 61 63 6c 61 73 73 20 3c | 73 6c 6f 74 2d 64 65 73 |aclass <|slot-des|
|000052d0| 63 72 69 70 74 69 6f 6e | 2d 63 6c 61 73 73 3e 29 |cription|-class>)|
|000052e0| 0a 5c 65 6e 64 6c 69 73 | 70 0a 0a 54 68 65 20 63 |.\endlis|p..The c|
|000052f0| 6c 61 73 73 65 64 2d 6c | 6f 63 61 6c 2d 73 6c 6f |lassed-l|ocal-slo|
|00005300| 74 2d 64 65 73 63 72 69 | 70 74 69 6f 6e 20 63 6c |t-descri|ption cl|
|00005310| 61 73 73 20 69 6e 68 65 | 72 69 74 73 20 74 68 65 |ass inhe|rits the|
|00005320| 20 6e 6f 72 6d 61 6c 20 | 73 6c 6f 74 73 0a 66 72 | normal |slots.fr|
|00005330| 6f 6d 20 5c 63 6c 61 73 | 73 6e 61 6d 65 7b 6c 6f |om \clas|sname{lo|
|00005340| 63 61 6c 5c 2d 2d 73 6c | 6f 74 5c 2d 2d 64 65 73 |cal\--sl|ot\--des|
|00005350| 63 72 69 70 74 69 6f 6e | 7d 20 61 6e 64 20 61 64 |cription|} and ad|
|00005360| 64 73 20 73 6f 6d 65 77 | 68 65 72 65 20 74 6f 20 |ds somew|here to |
|00005370| 6b 65 65 70 0a 74 72 61 | 63 6b 20 6f 66 20 74 68 |keep.tra|ck of th|
|00005380| 65 20 61 6c 6c 6f 77 65 | 64 20 63 6c 61 73 73 20 |e allowe|d class |
|00005390| 6f 66 20 69 74 73 20 63 | 6f 6e 74 65 6e 74 73 2e |of its c|ontents.|
|000053a0| 0a 0a 54 6f 20 70 6f 6c | 69 63 65 20 74 68 65 20 |..To pol|ice the |
|000053b0| 63 6c 61 73 73 20 28 74 | 79 70 65 29 20 63 6f 6e |class (t|ype) con|
|000053c0| 73 74 72 61 69 6e 74 2c | 20 77 65 20 6d 75 73 74 |straint,| we must|
|000053d0| 20 63 68 65 63 6b 20 74 | 68 61 74 20 77 68 65 6e | check t|hat when|
|000053e0| 65 76 65 72 20 61 0a 76 | 61 6c 75 65 20 69 73 20 |ever a.v|alue is |
|000053f0| 77 72 69 74 74 65 6e 20 | 74 6f 20 61 20 73 6c 6f |written |to a slo|
|00005400| 74 20 77 69 74 68 20 74 | 68 69 73 20 63 6c 61 73 |t with t|his clas|
|00005410| 73 2d 2d 2d 74 68 61 74 | 20 74 68 65 20 76 61 6c |s---that| the val|
|00005420| 75 65 20 69 73 20 6f 66 | 20 74 68 65 0a 73 70 65 |ue is of| the.spe|
|00005430| 63 69 66 69 65 64 20 6b | 69 6e 64 2e 20 77 65 20 |cified k|ind. we |
|00005440| 74 68 65 72 65 66 6f 72 | 65 20 77 61 6e 74 20 61 |therefor|e want a|
|00005450| 20 6e 65 77 20 6d 65 74 | 68 6f 64 20 6f 6e 20 7b | new met|hod on {|
|00005460| 5c 74 74 0a 63 6f 6d 70 | 75 74 65 5c 2d 2d 70 72 |\tt.comp|ute\--pr|
|00005470| 69 6d 69 74 69 76 65 5c | 2d 2d 77 72 69 74 65 72 |imitive\|--writer|
|00005480| 5c 2d 2d 75 73 69 6e 67 | 2d 73 6c 6f 74 5c 2d 2d |\--using|-slot\--|
|00005490| 64 65 73 63 72 69 70 74 | 69 6f 6e 7d 2e 20 0a 5c |descript|ion}. .\|
|000054a0| 62 65 67 69 6e 6c 69 73 | 70 0a 20 20 28 64 65 66 |beginlis|p. (def|
|000054b0| 6d 65 74 68 6f 64 20 63 | 6f 6d 70 75 74 65 2d 70 |method c|ompute-p|
|000054c0| 72 69 6d 69 74 69 76 65 | 2d 77 72 69 74 65 72 2d |rimitive|-writer-|
|000054d0| 75 73 69 6e 67 2d 73 6c | 6f 74 2d 64 65 73 63 72 |using-sl|ot-descr|
|000054e0| 69 70 74 69 6f 6e 20 0a | 20 20 20 20 28 28 63 73 |iption .| ((cs|
|000054f0| 64 20 3c 63 6c 61 73 73 | 65 64 2d 6c 6f 63 61 6c |d <class|ed-local|
|00005500| 2d 73 6c 6f 74 2d 64 65 | 73 63 72 69 70 74 69 6f |-slot-de|scriptio|
|00005510| 6e 3e 29 20 63 6c 20 6c | 73 74 29 0a 20 20 20 20 |n>) cl l|st). |
|00005520| 28 6c 65 74 20 28 28 73 | 74 64 2d 77 72 69 74 65 |(let ((s|td-write|
|00005530| 72 20 28 63 61 6c 6c 2d | 6e 65 78 74 2d 6d 65 74 |r (call-|next-met|
|00005540| 68 6f 64 29 29 0a 20 20 | 20 20 20 20 28 63 6f 6e |hod)). | (con|
|00005550| 74 65 6e 74 73 2d 63 6c | 20 28 63 6c 61 73 73 65 |tents-cl| (classe|
|00005560| 64 2d 6c 6f 63 61 6c 2d | 73 6c 6f 74 2d 64 65 73 |d-local-|slot-des|
|00005570| 63 72 69 70 74 69 6f 6e | 2d 63 6f 6e 74 65 6e 74 |cription|-content|
|00005580| 73 2d 63 6c 61 73 73 20 | 63 73 64 29 29 29 0a 20 |s-class |csd))). |
|00005590| 20 20 20 20 20 28 6c 61 | 6d 62 64 61 20 28 6f 62 | (la|mbda (ob|
|000055a0| 6a 20 76 61 6c 29 0a 20 | 20 20 20 20 20 20 20 28 |j val). | (|
|000055b0| 69 66 20 28 73 75 62 63 | 6c 61 73 73 70 20 28 63 |if (subc|lassp (c|
|000055c0| 6c 61 73 73 2d 6f 66 20 | 76 61 6c 29 20 63 6f 6e |lass-of |val) con|
|000055d0| 74 65 6e 74 73 2d 63 6c | 29 0a 20 20 20 20 20 20 |tents-cl|). |
|000055e0| 20 20 20 20 20 20 28 73 | 74 64 2d 77 72 69 74 65 | (s|td-write|
|000055f0| 72 20 6f 62 6a 20 76 61 | 6c 29 0a 20 20 20 20 20 |r obj va|l). |
|00005600| 20 20 20 20 20 28 65 72 | 72 6f 72 20 22 69 6e 76 | (er|ror "inv|
|00005610| 61 6c 69 64 20 63 6c 61 | 73 73 20 6f 66 20 76 61 |alid cla|ss of va|
|00005620| 6c 75 65 20 66 6f 72 20 | 73 6c 6f 74 22 0a 20 20 |lue for |slot". |
|00005630| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 73 | | s|
|00005640| 6f 6d 65 2d 65 72 72 6f | 72 20 27 6f 62 6a 65 63 |ome-erro|r 'objec|
|00005650| 74 20 6f 62 6a 20 27 73 | 64 20 63 73 64 20 27 76 |t obj 's|d csd 'v|
|00005660| 61 6c 20 76 61 6c 29 29 | 29 29 29 0a 5c 65 6e 64 |al val))|))).\end|
|00005670| 6c 69 73 70 0a 0a 54 68 | 65 20 63 61 6c 6c 20 74 |lisp..Th|e call t|
|00005680| 6f 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 77 |o the st|andard w|
|00005690| 72 69 74 65 72 20 69 73 | 20 72 65 61 63 68 65 64 |riter is| reached|
|000056a0| 20 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 76 61 6c | only if| the val|
|000056b0| 75 65 20 73 61 74 69 73 | 66 69 65 73 20 74 68 65 |ue satis|fies the|
|000056c0| 0a 63 6c 61 73 73 20 63 | 6f 6e 73 74 72 61 69 6e |.class c|onstrain|
|000056d0| 74 2e 20 49 74 20 6a 75 | 73 74 20 6d 65 61 6e 73 |t. It ju|st means|
|000056e0| 20 74 68 65 20 76 61 6c | 75 65 20 69 73 20 61 63 | the val|ue is ac|
|000056f0| 63 65 70 74 61 62 6c 65 | 2d 2d 2d 67 6f 20 61 68 |ceptable|---go ah|
|00005700| 65 61 64 20 61 6e 64 0a | 64 6f 20 77 68 61 74 65 |ead and.|do whate|
|00005710| 76 65 72 20 79 6f 75 20 | 6e 6f 72 6d 61 6c 6c 79 |ver you |normally|
|00005720| 20 64 6f 20 74 6f 20 70 | 75 74 20 74 68 65 20 73 | do to p|ut the s|
|00005730| 6c 6f 74 20 76 61 6c 75 | 65 20 69 6e 73 69 64 65 |lot valu|e inside|
|00005740| 2e 0a 0a 41 6c 6c 20 74 | 68 61 74 20 72 65 6d 61 |...All t|hat rema|
|00005750| 69 6e 73 20 69 73 20 68 | 6f 77 20 74 6f 20 75 73 |ins is h|ow to us|
|00005760| 65 20 6f 6e 65 20 6f 66 | 20 74 68 65 73 65 20 73 |e one of| these s|
|00005770| 6c 6f 74 73 20 69 6e 20 | 61 20 63 6c 61 73 73 2e |lots in |a class.|
|00005780| 20 54 68 65 0a 65 78 61 | 6d 70 6c 65 20 79 6f 75 | The.exa|mple you|
|00005790| 20 67 69 76 65 20 63 61 | 6e 20 62 65 20 64 6f 6e | give ca|n be don|
|000057a0| 65 20 61 73 20 66 6f 6c | 6c 6f 77 73 2d 2d 2d 62 |e as fol|lows---b|
|000057b0| 75 74 20 72 65 6d 65 6d | 62 65 72 20 74 68 61 74 |ut remem|ber that|
|000057c0| 20 7b 5c 74 74 0a 64 65 | 66 63 6c 61 73 73 7d 20 | {\tt.de|fclass} |
|000057d0| 6d 75 73 74 20 62 65 20 | 75 73 65 64 20 69 6e 73 |must be |used ins|
|000057e0| 74 65 61 64 20 6f 66 20 | 7b 5c 74 74 20 64 65 66 |tead of |{\tt def|
|000057f0| 73 74 72 75 63 74 7d 20 | 62 65 63 61 75 73 65 20 |struct} |because |
|00005800| 74 68 65 20 6c 61 74 74 | 65 72 0a 64 6f 65 73 20 |the latt|er.does |
|00005810| 6e 6f 74 20 73 75 70 70 | 6f 72 74 20 75 73 65 72 |not supp|ort user|
|00005820| 2d 64 65 66 69 6e 65 64 | 20 73 6c 6f 74 20 63 6c |-defined| slot cl|
|00005830| 61 73 73 65 73 2e 0a 0a | 5c 62 65 67 69 6e 7b 76 |asses...|\begin{v|
|00005840| 65 72 62 61 74 69 6d 7d | 0a 20 20 28 64 65 66 63 |erbatim}|. (defc|
|00005850| 6c 61 73 73 20 3c 70 65 | 72 73 6f 6e 3e 20 28 29 |lass <pe|rson> ()|
|00005860| 0a 20 20 20 20 28 28 61 | 67 65 20 73 6c 6f 74 2d |. ((a|ge slot-|
|00005870| 63 6c 61 73 73 20 3c 63 | 6c 61 73 73 65 64 2d 6c |class <c|lassed-l|
|00005880| 6f 63 61 6c 2d 73 6c 6f | 74 2d 64 65 73 63 72 69 |ocal-slo|t-descri|
|00005890| 70 74 69 6f 6e 3e 0a 20 | 20 20 20 20 20 20 20 20 |ption>. | |
|000058a0| 20 69 6e 69 74 61 72 67 | 20 61 67 65 0a 20 20 20 | initarg| age. |
|000058b0| 20 20 20 20 20 20 20 73 | 6c 6f 74 2d 69 6e 69 74 | s|lot-init|
|000058c0| 61 72 67 73 20 28 27 63 | 6f 6e 74 65 6e 74 73 2d |args ('c|ontents-|
|000058d0| 63 6c 61 73 73 20 3c 69 | 6e 74 65 67 65 72 3e 29 |class <i|nteger>)|
|000058e0| 20 61 63 63 65 73 73 6f | 72 20 61 67 65 29 0a 20 | accesso|r age). |
|000058f0| 20 20 20 20 28 6e 61 6d | 65 20 73 6c 6f 74 2d 63 | (nam|e slot-c|
|00005900| 6c 61 73 73 20 3c 63 6c | 61 73 73 65 64 2d 6c 6f |lass <cl|assed-lo|
|00005910| 63 61 6c 2d 73 6c 6f 74 | 2d 64 65 73 63 72 69 70 |cal-slot|-descrip|
|00005920| 74 69 6f 6e 3e 0a 20 20 | 20 20 20 20 20 20 20 20 |tion>. | |
|00005930| 20 73 6c 6f 74 2d 69 6e | 69 74 61 72 67 73 20 28 | slot-in|itargs (|
|00005940| 27 63 6f 6e 74 65 6e 74 | 73 2d 63 6c 61 73 73 20 |'content|s-class |
|00005950| 3c 73 74 72 69 6e 67 3e | 29 0a 20 20 20 20 20 20 |<string>|). |
|00005960| 20 20 20 20 20 61 63 63 | 65 73 73 6f 72 20 6e 61 | acc|essor na|
|00005970| 6d 65 29 20 0a 20 20 20 | 20 20 28 6f 72 64 69 6e |me) . | (ordin|
|00005980| 61 72 79 2d 73 6c 6f 74 | 20 69 6e 69 74 66 6f 72 |ary-slot| initfor|
|00005990| 6d 20 27 62 6c 65 61 67 | 68 29 29 0a 20 20 20 20 |m 'bleag|h)). |
|000059a0| 29 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |).\end{v|erbatim}|
|000059b0| 0a 0a 54 68 65 20 73 6c | 6f 74 73 20 7b 5c 74 74 |..The sl|ots {\tt|
|000059c0| 20 61 67 65 7d 20 61 6e | 64 20 7b 5c 74 74 20 6e | age} an|d {\tt n|
|000059d0| 61 6d 65 7d 20 61 72 65 | 20 6f 66 20 74 68 65 20 |ame} are| of the |
|000059e0| 6e 65 77 20 63 6c 61 73 | 73 20 6f 66 20 73 6c 6f |new clas|s of slo|
|000059f0| 74 20 77 69 74 68 0a 74 | 68 65 69 72 20 63 6f 6e |t with.t|heir con|
|00005a00| 74 65 6e 74 73 20 63 6c | 61 73 73 20 73 65 74 20 |tents cl|ass set |
|00005a10| 74 6f 20 7b 5c 74 74 20 | 69 6e 74 65 67 65 72 7d |to {\tt |integer}|
|00005a20| 20 61 6e 64 20 7b 5c 74 | 74 20 73 74 72 69 6e 67 | and {\t|t string|
|00005a30| 7d 0a 72 65 73 70 65 63 | 74 69 76 65 6c 79 2e 20 |}.respec|tively. |
|00005a40| 20 4f 66 20 63 6f 75 72 | 73 65 2c 20 6f 74 68 65 | Of cour|se, othe|
|00005a50| 72 20 73 6c 6f 74 73 20 | 77 69 74 68 20 64 69 66 |r slots |with dif|
|00005a60| 66 65 72 65 6e 74 20 63 | 6c 61 73 73 65 73 20 6f |ferent c|lasses o|
|00005a70| 66 20 73 6c 6f 74 0a 64 | 65 73 63 72 69 70 74 69 |f slot.d|escripti|
|00005a80| 6f 6e 20 6d 61 79 20 61 | 6c 73 6f 20 62 65 20 64 |on may a|lso be d|
|00005a90| 65 66 69 6e 65 64 2e 0a | 0a 4e 6f 77 2c 20 77 65 |efined..|.Now, we|
|00005aa0| 20 6d 61 79 20 74 79 70 | 65 20 74 68 65 20 66 6f | may typ|e the fo|
|00005ab0| 6c 6c 6f 77 69 6e 67 3a | 0a 0a 5c 62 65 67 69 6e |llowing:|..\begin|
|00005ac0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 20 20 28 73 65 |{verbati|m}. (se|
|00005ad0| 74 71 20 69 20 28 6d 61 | 6b 65 20 3c 70 65 72 73 |tq i (ma|ke <pers|
|00005ae0| 6f 6e 3e 29 29 20 28 28 | 73 65 74 74 65 72 20 61 |on>)) ((|setter a|
|00005af0| 67 65 29 20 69 20 32 37 | 29 0a 5c 65 6e 64 7b 76 |ge) i 27|).\end{v|
|00005b00| 65 72 62 61 74 69 6d 7d | 0a 0a 5c 6e 6f 69 6e 64 |erbatim}|..\noind|
|00005b10| 65 6e 74 0a 77 68 69 63 | 68 20 69 73 20 66 69 6e |ent.whic|h is fin|
|00005b20| 65 20 61 6e 64 20 7b 5c | 74 74 20 28 61 67 65 20 |e and {\|tt (age |
|00005b30| 69 29 7d 20 77 69 6c 6c | 20 72 65 74 75 72 6e 20 |i)} will| return |
|00005b40| 7b 5c 74 74 20 32 37 7d | 2e 0a 0a 5c 62 65 67 69 |{\tt 27}|...\begi|
|00005b50| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0a 20 20 28 28 |n{verbat|im}. ((|
|00005b60| 73 65 74 74 65 72 20 61 | 67 65 29 20 69 20 27 6e |setter a|ge) i 'n|
|00005b70| 6f 74 2d 61 2d 6e 75 6d | 62 65 72 29 0a 5c 65 6e |ot-a-num|ber).\en|
|00005b80| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 0a 5c 6e 6f |d{verbat|im}..\no|
|00005b90| 69 6e 64 65 6e 74 0a 62 | 75 74 20 74 68 69 73 20 |indent.b|ut this |
|00005ba0| 73 69 67 6e 61 6c 73 20 | 61 6e 20 65 72 72 6f 72 |signals |an error|
|00005bb0| 2e 20 20 54 68 61 6e 6b | 73 20 74 6f 20 4c 75 69 |. Thank|s to Lui|
|00005bc0| 73 20 4d 61 6e 64 65 6c | 20 66 6f 72 20 70 72 6f |s Mandel| for pro|
|00005bd0| 6d 70 74 69 6e 67 20 74 | 68 69 73 0a 65 78 61 6d |mpting t|his.exam|
|00005be0| 70 6c 65 2e 0a 0a 5c 73 | 75 62 73 65 63 74 69 6f |ple...\s|ubsectio|
|00005bf0| 6e 7b 4d 69 78 69 6e 73 | 7d 0a 0a 5c 66 65 65 6c |n{Mixins|}..\feel|
|00005c00| 5c 20 73 75 70 70 6c 69 | 65 73 20 61 20 6d 69 78 |\ suppli|es a mix|
|00005c10| 69 6e 20 6d 6f 64 75 6c | 65 5c 66 6f 6f 74 6e 6f |in modul|e\footno|
|00005c20| 74 65 7b 63 61 6c 6c 65 | 64 20 5c 66 69 6c 65 6e |te{calle|d \filen|
|00005c30| 61 6d 65 7b 6d 69 78 69 | 6e 73 7d 7d 20 74 6f 0a |ame{mixi|ns}} to.|
|00005c40| 61 6c 6c 6f 77 20 74 68 | 65 20 75 73 65 20 6d 69 |allow th|e use mi|
|00005c50| 78 69 6e 20 63 6c 61 73 | 73 65 73 20 5c 60 61 20 |xin clas|ses \`a |
|00005c60| 6c 61 20 66 6c 61 76 6f | 72 73 5c 63 6f 6d 6d 65 |la flavo|rs\comme|
|00005c70| 6e 74 7b 72 69 67 68 74 | 3f 7d 2e 20 41 20 6d 69 |nt{right|?}. A mi|
|00005c80| 78 69 6e 0a 63 6c 61 73 | 73 20 69 73 20 61 20 63 |xin.clas|s is a c|
|00005c90| 6c 61 73 73 20 74 68 61 | 74 20 63 61 6e 20 62 65 |lass tha|t can be|
|00005ca0| 20 75 73 65 64 20 69 6e | 20 61 20 6d 75 6c 74 69 | used in| a multi|
|00005cb0| 70 6c 65 20 69 6e 68 65 | 72 69 74 61 6e 63 65 20 |ple inhe|ritance |
|00005cc0| 6e 65 74 77 6f 72 6b 2c | 0a 62 75 74 20 68 61 73 |network,|.but has|
|00005cd0| 20 63 65 72 74 61 69 6e | 20 72 65 73 74 72 69 63 | certain| restric|
|00005ce0| 74 69 6f 6e 73 20 74 6f | 20 65 6e 61 62 6c 65 20 |tions to| enable |
|00005cf0| 74 68 65 20 63 72 65 61 | 74 69 6f 6e 20 6f 66 20 |the crea|tion of |
|00005d00| 6d 6f 72 65 20 65 66 66 | 69 63 69 65 6e 74 0a 61 |more eff|icient.a|
|00005d10| 63 63 65 73 73 6f 72 73 | 2d 2d 2d 6d 75 6c 74 69 |ccessors|---multi|
|00005d20| 70 6c 65 20 69 6e 68 65 | 72 69 74 61 6e 63 65 20 |ple inhe|ritance |
|00005d30| 69 73 20 72 65 73 74 72 | 69 63 74 65 64 20 74 6f |is restr|icted to|
|00005d40| 20 6e 6f 6e 2d 69 6e 73 | 74 61 6e 74 69 61 62 6c | non-ins|tantiabl|
|00005d50| 65 0a 63 6c 61 73 73 65 | 73 20 61 6e 64 20 74 68 |e.classe|s and th|
|00005d60| 65 73 65 20 63 6c 61 73 | 73 65 73 2c 20 7b 5c 65 |ese clas|ses, {\e|
|00005d70| 6d 20 6d 69 78 69 6e 73 | 7d 5c 20 61 72 65 20 74 |m mixins|}\ are t|
|00005d80| 68 65 6e 20 75 73 65 64 | 20 66 6f 72 0a 73 70 65 |hen used| for.spe|
|00005d90| 63 69 61 6c 69 73 61 74 | 69 6f 6e 20 6f 66 20 69 |cialisat|ion of i|
|00005da0| 6e 73 74 61 6e 74 69 61 | 62 6c 65 20 6f 62 6a 65 |nstantia|ble obje|
|00005db0| 63 74 73 2c 20 7b 5c 65 | 6d 20 62 61 73 65 2d 6f |cts, {\e|m base-o|
|00005dc0| 62 6a 65 63 74 73 7d 2e | 20 4d 69 78 69 6e 73 0a |bjects}.| Mixins.|
|00005dd0| 74 65 6e 64 20 74 6f 20 | 62 65 20 75 73 65 64 20 |tend to |be used |
|00005de0| 74 6f 20 64 65 73 63 72 | 69 62 65 20 61 74 74 72 |to descr|ibe attr|
|00005df0| 69 62 75 74 65 73 20 6f | 66 20 6f 62 6a 65 63 74 |ibutes o|f object|
|00005e00| 73 2c 20 61 6e 64 20 74 | 68 65 6e 20 74 68 65 73 |s, and t|hen thes|
|00005e10| 65 20 61 72 65 0a 60 60 | 6d 69 78 65 64 20 69 6e |e are.``|mixed in|
|00005e20| 27 27 20 77 69 74 68 20 | 62 61 73 65 20 63 6c 61 |'' with |base cla|
|00005e30| 73 73 65 73 20 74 6f 20 | 63 72 65 61 74 65 20 73 |sses to |create s|
|00005e40| 70 65 63 69 61 6c 69 7a | 65 64 20 63 6c 61 73 73 |pecializ|ed class|
|00005e50| 65 73 2e 20 54 68 65 0a | 6d 69 78 69 6e 20 69 6d |es. The.|mixin im|
|00005e60| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 68 61 73 |plementa|tion has|
|00005e70| 20 74 77 6f 20 6d 65 74 | 61 63 6c 61 73 73 65 73 | two met|aclasses|
|00005e80| 0a 5c 62 65 67 69 6e 7b | 69 74 65 6d 69 7a 65 7d |.\begin{|itemize}|
|00005e90| 0a 5c 69 74 65 6d 20 5c | 63 6c 61 73 73 6e 61 6d |.\item \|classnam|
|00005ea0| 65 7b 6d 69 78 69 6e 2d | 63 6c 61 73 73 7d 20 54 |e{mixin-|class} T|
|00005eb0| 68 65 20 63 6c 61 73 73 | 20 6f 66 20 61 20 6d 69 |he class| of a mi|
|00005ec0| 78 69 6e 20 63 6c 61 73 | 73 0a 5c 69 74 65 6d 20 |xin clas|s.\item |
|00005ed0| 5c 63 6c 61 73 73 6e 61 | 6d 65 7b 6d 69 78 69 6e |\classna|me{mixin|
|00005ee0| 2d 62 61 73 65 2d 63 6c | 61 73 73 7d 20 54 68 65 |-base-cl|ass} The|
|00005ef0| 20 63 6c 61 73 73 20 6f | 66 20 61 20 62 61 73 65 | class o|f a base|
|00005f00| 2d 6f 62 6a 65 63 74 20 | 63 6c 61 73 73 20 0a 5c |-object |class .\|
|00005f10| 65 6e 64 7b 69 74 65 6d | 69 7a 65 7d 0a 0a 49 6e |end{item|ize}..In|
|00005f20| 73 74 61 6e 63 65 73 20 | 6f 66 20 5c 63 6c 61 73 |stances |of \clas|
|00005f30| 73 6e 61 6d 65 7b 6d 69 | 78 69 6e 2d 63 6c 61 73 |sname{mi|xin-clas|
|00005f40| 73 7d 20 61 72 65 20 6e | 6f 74 20 69 6e 73 74 61 |s} are n|ot insta|
|00005f50| 6e 74 69 61 62 6c 65 2c | 20 62 75 74 20 61 6c 6c |ntiable,| but all|
|00005f60| 6f 77 20 66 75 6c 6c 20 | 4d 49 2e 0a 4f 6e 6c 79 |ow full |MI..Only|
|00005f70| 20 69 6e 73 74 61 6e 63 | 65 73 20 6f 66 20 5c 63 | instanc|es of \c|
|00005f80| 6c 61 73 73 6e 61 6d 65 | 7b 6d 69 78 69 6e 2d 62 |lassname|{mixin-b|
|00005f90| 61 73 65 2d 63 6c 61 73 | 73 7d 20 6d 61 79 20 69 |ase-clas|s} may i|
|00005fa0| 6e 68 65 72 69 74 20 66 | 72 6f 6d 0a 6d 69 78 69 |nherit f|rom.mixi|
|00005fb0| 6e 2d 63 6c 61 73 73 65 | 73 2c 20 61 6e 64 20 74 |n-classe|s, and t|
|00005fc0| 68 65 20 6c 69 73 74 20 | 6f 66 20 64 69 72 65 63 |he list |of direc|
|00005fd0| 74 20 73 75 70 65 72 63 | 6c 61 73 73 65 73 20 6f |t superc|lasses o|
|00005fe0| 66 20 61 0a 5c 63 6c 61 | 73 73 6e 61 6d 65 7b 6d |f a.\cla|ssname{m|
|00005ff0| 69 78 69 6e 2d 62 61 73 | 65 2d 63 6c 61 73 73 7d |ixin-bas|e-class}|
|00006000| 20 6d 75 73 74 20 68 61 | 76 65 20 61 6c 6c 20 6d | must ha|ve all m|
|00006010| 69 78 69 6e 2d 63 6c 61 | 73 73 65 73 20 62 65 66 |ixin-cla|sses bef|
|00006020| 6f 72 65 20 61 0a 73 69 | 6e 67 6c 65 20 6e 6f 6e |ore a.si|ngle non|
|00006030| 2d 6d 69 78 69 6e 20 63 | 6c 61 73 73 20 28 49 6e |-mixin c|lass (In|
|00006040| 20 5c 66 65 65 6c 2c 20 | 69 74 20 6d 61 79 20 69 | \feel, |it may i|
|00006050| 6e 68 65 72 69 74 20 66 | 72 6f 6d 20 61 6e 79 20 |nherit f|rom any |
|00006060| 6f 74 68 65 72 20 63 6c | 61 73 73 20 69 6e 0a 74 |other cl|ass in.t|
|00006070| 68 65 20 73 79 73 74 65 | 6d 2c 20 69 6e 63 6c 75 |he syste|m, inclu|
|00006080| 64 69 6e 67 20 5c 63 6c | 61 73 73 6e 61 6d 65 7b |ding \cl|assname{|
|00006090| 63 6c 61 73 73 7d 29 2e | 0a 0a 5c 62 65 67 69 6e |class}).|..\begin|
|000060a0| 7b 66 69 67 75 72 65 7d | 0a 5c 62 65 67 69 6e 6c |{figure}|.\beginl|
|000060b0| 69 73 70 0a 28 64 65 66 | 63 6c 61 73 73 20 3c 70 |isp.(def|class <p|
|000060c0| 6f 69 6e 74 3e 20 28 29 | 0a 20 20 28 28 78 20 69 |oint> ()|. ((x i|
|000060d0| 6e 69 74 66 6f 72 6d 20 | 30 20 61 63 63 65 73 73 |nitform |0 access|
|000060e0| 6f 72 20 70 6f 69 6e 74 | 2d 78 20 69 6e 69 74 61 |or point|-x inita|
|000060f0| 72 67 20 78 29 0a 20 20 | 20 28 79 20 69 6e 69 74 |rg x). | (y init|
|00006100| 66 6f 72 6d 20 30 20 61 | 63 63 65 73 73 6f 72 20 |form 0 a|ccessor |
|00006110| 70 6f 69 6e 74 2d 79 20 | 69 6e 69 74 61 72 67 20 |point-y |initarg |
|00006120| 79 29 29 0a 20 20 29 0a | 0a 28 64 65 66 63 6c 61 |y)). ).|.(defcla|
|00006130| 73 73 20 3c 63 6f 6c 6f | 72 65 64 3e 20 28 29 0a |ss <colo|red> ().|
|00006140| 20 20 28 28 63 6f 6c 6f | 72 20 69 6e 69 74 66 6f | ((colo|r initfo|
|00006150| 72 6d 20 27 62 6c 61 63 | 6b 20 69 6e 69 74 61 72 |rm 'blac|k initar|
|00006160| 67 20 63 6f 6c 6f 72 20 | 0a 09 20 20 72 65 61 64 |g color |.. read|
|00006170| 65 72 20 63 6f 6c 6f 72 | 29 29 0a 20 20 6d 65 74 |er color|)). met|
|00006180| 61 63 6c 61 73 73 20 3c | 6d 69 78 69 6e 2d 63 6c |aclass <|mixin-cl|
|00006190| 61 73 73 3e 29 0a 0a 28 | 64 65 66 67 65 6e 65 72 |ass>)..(|defgener|
|000061a0| 69 63 20 63 6f 6c 6f 72 | 2d 6f 66 20 28 6f 62 6a |ic color|-of (obj|
|000061b0| 29 0a 20 20 6d 65 74 68 | 6f 64 20 28 28 28 6f 62 |). meth|od (((ob|
|000061c0| 6a 20 3c 6f 62 6a 65 63 | 74 3e 29 29 20 27 67 72 |j <objec|t>)) 'gr|
|000061d0| 61 79 29 0a 20 20 6d 65 | 74 68 6f 64 20 28 28 28 |ay). me|thod (((|
|000061e0| 6f 62 6a 20 3c 63 6f 6c | 6f 72 65 64 3e 29 29 0a |obj <col|ored>)).|
|000061f0| 09 20 20 28 63 6f 6c 6f | 72 20 6f 62 6a 29 29 29 |. (colo|r obj)))|
|00006200| 0a 0a 28 64 65 66 63 6c | 61 73 73 20 3c 63 6f 6c |..(defcl|ass <col|
|00006210| 6f 72 65 64 2d 70 6f 69 | 6e 74 3e 20 28 3c 63 6f |ored-poi|nt> (<co|
|00006220| 6c 6f 72 65 64 3e 20 3c | 70 6f 69 6e 74 3e 29 20 |lored> <|point>) |
|00006230| 0a 20 20 28 29 0a 20 20 | 6d 65 74 61 63 6c 61 73 |. (). |metaclas|
|00006240| 73 20 3c 6d 69 78 69 6e | 2d 62 61 73 65 2d 63 6c |s <mixin|-base-cl|
|00006250| 61 73 73 3e 29 0a 0a 28 | 73 65 74 71 20 70 31 20 |ass>)..(|setq p1 |
|00006260| 28 6d 61 6b 65 20 3c 70 | 6f 69 6e 74 3e 29 29 0a |(make <p|oint>)).|
|00006270| 28 63 6f 6c 6f 72 2d 6f | 66 20 70 31 29 0a 0a 28 |(color-o|f p1)..(|
|00006280| 73 65 74 71 20 70 32 20 | 28 6d 61 6b 65 20 3c 63 |setq p2 |(make <c|
|00006290| 6f 6c 6f 72 65 64 2d 70 | 6f 69 6e 74 3e 20 27 78 |olored-p|oint> 'x|
|000062a0| 20 31 20 27 79 20 31 20 | 27 63 6f 6c 6f 72 20 27 | 1 'y 1 |'color '|
|000062b0| 72 65 64 29 29 0a 28 63 | 6f 6c 6f 72 2d 6f 66 20 |red)).(c|olor-of |
|000062c0| 70 32 29 0a 5c 65 6e 64 | 6c 69 73 70 0a 5c 63 61 |p2).\end|lisp.\ca|
|000062d0| 70 74 69 6f 6e 7b 55 73 | 61 67 65 20 6f 66 20 6d |ption{Us|age of m|
|000062e0| 69 78 69 6e 20 69 6e 68 | 65 72 74 61 6e 63 65 7d |ixin inh|ertance}|
|000062f0| 0a 5c 65 6e 64 7b 66 69 | 67 75 72 65 7d 0a 4e 6f |.\end{fi|gure}.No|
|00006300| 74 65 20 6f 6e 20 74 68 | 65 20 69 6d 70 6c 65 6d |te on th|e implem|
|00006310| 65 6e 74 61 74 69 6f 6e | 3a 20 5c 63 6c 61 73 73 |entation|: \class|
|00006320| 6e 61 6d 65 7b 6d 69 78 | 69 6e 2d 63 6c 61 73 73 |name{mix|in-class|
|00006330| 7d 20 68 61 73 20 61 20 | 64 69 66 66 65 72 65 6e |} has a |differen|
|00006340| 74 0a 64 65 66 61 75 6c | 74 20 73 6c 6f 74 20 74 |t.defaul|t slot t|
|00006350| 79 70 65 2c 20 5c 63 6c | 61 73 73 6e 61 6d 65 7b |ype, \cl|assname{|
|00006360| 6d 69 78 69 6e 2d 73 6c | 6f 74 2d 64 65 73 63 72 |mixin-sl|ot-descr|
|00006370| 69 70 74 69 6f 6e 7d 2e | 20 57 68 65 6e 20 74 68 |iption}.| When th|
|00006380| 69 73 20 73 6c 6f 74 0a | 69 73 20 69 6e 68 65 72 |is slot.|is inher|
|00006390| 69 74 65 64 20 7b 5c 65 | 6d 20 64 69 72 65 63 74 |ited {\e|m direct|
|000063a0| 6c 79 7d 20 62 79 20 61 | 20 5c 63 6c 61 73 73 6e |ly} by a| \classn|
|000063b0| 61 6d 65 7b 6d 69 5c 2d | 78 69 6e 2d 62 61 73 65 |ame{mi\-|xin-base|
|000063c0| 2d 63 6c 5c 2d 61 73 73 | 7d 20 69 74 73 0a 74 68 |-cl\-ass|} its.th|
|000063d0| 65 20 61 63 63 65 73 73 | 6f 72 20 69 73 20 63 6f |e access|or is co|
|000063e0| 6d 70 75 74 65 64 2e 20 | 49 66 20 74 68 65 20 73 |mputed. |If the s|
|000063f0| 6c 6f 74 20 69 73 20 6e | 6f 74 20 6e 65 77 6c 79 |lot is n|ot newly|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.